Instructions to use poolside/Laguna-S-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside/Laguna-S-2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="poolside/Laguna-S-2.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("poolside/Laguna-S-2.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside/Laguna-S-2.1", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use poolside/Laguna-S-2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "poolside/Laguna-S-2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside/Laguna-S-2.1
- SGLang
How to use poolside/Laguna-S-2.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "poolside/Laguna-S-2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "poolside/Laguna-S-2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside/Laguna-S-2.1 with Docker Model Runner:
docker model run hf.co/poolside/Laguna-S-2.1
DFlash draft acceptance ~10% (greedy) after the 07-23 yarn_attn_factor re-quant — does the draft need regenerating?
Running the README's DFlash command, draft acceptance is ~10% at greedy (temperature 0) — well below usable, and the result is slower than no speculation (~8 t/s vs ~20 t/s baseline).
Measurements
draft acceptance = 0.108 (158 / 2053), mean len 2.1 — temp 0.8draft acceptance = 0.106 (181 / 1713), mean len 2.5 — temp 0 (greedy)
Setup
- Single RTX 4090, build from
poolsideai/llama.cpp@laguna(commit 04b2b72, 07-21) - Files = current HF HEAD of this repo:
laguna-s-2.1-Q4_K_M.gguf— the 07-23 "Q4_K_M: correct yarn_attn_factor to 1.0 (llama.cpp derives mscale)" re-uploadlaguna-s-2.1-DFlash-BF16.gguf— 07-22 "Correct DFlash config (#12)"
Command — verified config-independent (same ~10% with or without KV quant, -kvu, --no-mmap, thinking mode). Below is the exact greedy run:
llama-server \
-m laguna-s-2.1-Q4_K_M.gguf \
-md laguna-s-2.1-DFlash-BF16.gguf \
--spec-type draft-dflash --spec-draft-n-max 15 \
-fa on --jinja \
-ngl all -ngld all -ncmoe 41 \
-c 8192 --port 1234 --host 0.0.0.0
Load (draft parses cleanly — the ctx_other line is the benign memory-fitting warning the log itself flags as normal):
common_speculative_impl_draft_dflash: adding speculative implementation 'draft-dflash'
common_speculative_impl_draft_dflash: - n_max=15, n_min=0, p_min=0.00
common_speculative_impl_draft_dflash: - block_size=16, mask_token_id=12, n_extract=6
srv llama_server: model loaded
Result (temperature 0, n_predict 300):
eval time = 35801.06 ms / 300 tokens ( 119.34 ms per token, 8.38 tokens per second)
draft acceptance = 0.10566 ( 181 accepted / 1713 generated), mean len = 2.53
Hypothesis
The DFlash draft (07-22) predates the 07-23 yarn_attn_factor correction to the main model. Since DFlash keys off the target's intermediate hidden states, a change to the target's YaRN/mscale scaling shifts exactly what the draft was aligned against. Does laguna-s-2.1-DFlash-BF16.gguf need regenerating against the corrected main model? Happy to re-test any updated draft.
Configuration Mean accepted/step Time
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━ ━━━━━━━
Unpatched 0.00 4.51s
──────────────────────────────────────── ──────────────────── ───────
Basis + original embedding/head 1.18 3.72s
──────────────────────────────────────── ──────────────────── ───────
Basis + embedding/head + original RoPE 2.36 3.20s
Ask Codex to fix
- Target/verifier: poolside/Laguna-S-2.1-FP8
- Revision: fc72eb9025540b2225a681bb81950cc1225ff286
- Current spinquantless FP8 weights, unchanged.
- DFlash drafter: poolside/Laguna-S-2.1-DFlash-FP8
- Revision: 72caac8a84257a19f1ef55210c41cfcda67a30c2
- Original published model.safetensors.
- Drafter embedding and LM head: extracted from the original target revision 259f52ebef0fea03eca44c4ee545e0ddd224effc
- Source shard: model-00002-of-00024.safetensors
- Packaged as target-shared.safetensors
- SHA-256: 662ac68f453dd7b4a426b4471d4db02d82754c1753b83ad666abae2e24391be7