Text Generation
MLX
Safetensors
qwen3
1-bit
mlx-swift
apple-silicon
on-device
prismml
bonsai
conversational
Eval Results
Instructions to use prism-ml/Bonsai-8B-mlx-1bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use prism-ml/Bonsai-8B-mlx-1bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("prism-ml/Bonsai-8B-mlx-1bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use prism-ml/Bonsai-8B-mlx-1bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-8B-mlx-1bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prism-ml/Bonsai-8B-mlx-1bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use prism-ml/Bonsai-8B-mlx-1bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-8B-mlx-1bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prism-ml/Bonsai-8B-mlx-1bit
Run Hermes
hermes
- OpenClaw new
How to use prism-ml/Bonsai-8B-mlx-1bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-8B-mlx-1bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prism-ml/Bonsai-8B-mlx-1bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use prism-ml/Bonsai-8B-mlx-1bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "prism-ml/Bonsai-8B-mlx-1bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "prism-ml/Bonsai-8B-mlx-1bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prism-ml/Bonsai-8B-mlx-1bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
| { | |
| "vocab_size": 151669, | |
| "max_position_embeddings": 65536, | |
| "hidden_size": 4096, | |
| "intermediate_size": 12288, | |
| "num_hidden_layers": 36, | |
| "num_attention_heads": 32, | |
| "use_sliding_window": false, | |
| "sliding_window": null, | |
| "max_window_layers": 28, | |
| "num_key_value_heads": 8, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "use_cache": true, | |
| "rope_theta": 1000000.0, | |
| "rope_scaling": { | |
| "rope_type": "yarn", | |
| "factor": 4.0, | |
| "original_max_position_embeddings": 16384 | |
| }, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "return_dict": true, | |
| "output_hidden_states": false, | |
| "torchscript": false, | |
| "dtype": null, | |
| "pruned_heads": {}, | |
| "tie_word_embeddings": false, | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "is_decoder": false, | |
| "cross_attention_hidden_size": null, | |
| "add_cross_attention": false, | |
| "tie_encoder_decoder": false, | |
| "architectures": [ | |
| "Qwen3ForCausalLM" | |
| ], | |
| "finetuning_task": null, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "task_specific_params": null, | |
| "problem_type": null, | |
| "tokenizer_class": null, | |
| "prefix": null, | |
| "bos_token_id": null, | |
| "pad_token_id": 151643, | |
| "eos_token_id": 151645, | |
| "sep_token_id": null, | |
| "decoder_start_token_id": null, | |
| "max_length": 20, | |
| "min_length": 0, | |
| "do_sample": false, | |
| "early_stopping": false, | |
| "num_beams": 1, | |
| "temperature": 1.0, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "typical_p": 1.0, | |
| "repetition_penalty": 1.0, | |
| "length_penalty": 1.0, | |
| "no_repeat_ngram_size": 0, | |
| "encoder_no_repeat_ngram_size": 0, | |
| "bad_words_ids": null, | |
| "num_return_sequences": 1, | |
| "output_scores": false, | |
| "return_dict_in_generate": false, | |
| "forced_bos_token_id": null, | |
| "forced_eos_token_id": null, | |
| "remove_invalid_values": false, | |
| "exponential_decay_length_penalty": null, | |
| "suppress_tokens": null, | |
| "begin_suppress_tokens": [ | |
| 151643, | |
| 151645 | |
| ], | |
| "num_beam_groups": 1, | |
| "diversity_penalty": 0.0, | |
| "_name_or_path": "", | |
| "transformers_version": "4.57.6", | |
| "no_bias": true, | |
| "tf_legacy_loss": false, | |
| "use_bfloat16": false, | |
| "model_type": "qwen3", | |
| "output_attentions": false, | |
| "quantization": { | |
| "group_size": 128, | |
| "bits": 1 | |
| } | |
| } |