Instructions to use DreamFoundries/Laguna-S-2.1-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use DreamFoundries/Laguna-S-2.1-6bit 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("DreamFoundries/Laguna-S-2.1-6bit") 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 DreamFoundries/Laguna-S-2.1-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "DreamFoundries/Laguna-S-2.1-6bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "DreamFoundries/Laguna-S-2.1-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use DreamFoundries/Laguna-S-2.1-6bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "DreamFoundries/Laguna-S-2.1-6bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "DreamFoundries/Laguna-S-2.1-6bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFoundries/Laguna-S-2.1-6bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use DreamFoundries/Laguna-S-2.1-6bit 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 "DreamFoundries/Laguna-S-2.1-6bit"
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 DreamFoundries/Laguna-S-2.1-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use DreamFoundries/Laguna-S-2.1-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "DreamFoundries/Laguna-S-2.1-6bit"
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 "DreamFoundries/Laguna-S-2.1-6bit" \ --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"
| { | |
| "architectures": [ | |
| "LagunaForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "auto_map": { | |
| "AutoConfig": "configuration_laguna.LagunaConfig", | |
| "AutoModelForCausalLM": "modeling_laguna.LagunaForCausalLM" | |
| }, | |
| "bos_token_id": 2, | |
| "decoder_sparse_step": 1, | |
| "eos_token_id": [ | |
| 2, | |
| 24 | |
| ], | |
| "gating": "per-head", | |
| "gating_types": [ | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head", | |
| "per_head" | |
| ], | |
| "head_dim": 128, | |
| "hidden_size": 3072, | |
| "intermediate_size": 12288, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention" | |
| ], | |
| "max_position_embeddings": 1048576, | |
| "mlp_layer_types": [ | |
| "dense", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse" | |
| ], | |
| "mlp_only_layers": [ | |
| 0 | |
| ], | |
| "model_type": "laguna", | |
| "moe_apply_router_weight_on_input": false, | |
| "moe_intermediate_size": 1024, | |
| "moe_routed_scaling_factor": 2.5, | |
| "moe_router_logit_softcapping": 0.0, | |
| "norm_topk_prob": true, | |
| "num_attention_heads": 48, | |
| "num_attention_heads_per_layer": [ | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72, | |
| 48, | |
| 72, | |
| 72, | |
| 72 | |
| ], | |
| "num_experts": 256, | |
| "num_experts_per_tok": 10, | |
| "num_hidden_layers": 48, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": 9, | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 6, | |
| "mode": "affine" | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 6, | |
| "mode": "affine" | |
| }, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "full_attention": { | |
| "rope_theta": 500000.0, | |
| "rope_type": "yarn", | |
| "factor": 128.0, | |
| "original_max_position_embeddings": 8192, | |
| "beta_slow": 1.0, | |
| "beta_fast": 32.0, | |
| "attention_factor": 1.4852030263919618, | |
| "partial_rotary_factor": 0.5 | |
| }, | |
| "sliding_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 10000.0, | |
| "partial_rotary_factor": 1.0 | |
| } | |
| }, | |
| "router_aux_loss_coef": 0.0, | |
| "shared_expert_intermediate_size": 1024, | |
| "sliding_window": 512, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "use_cache": true, | |
| "vocab_size": 100352 | |
| } |