Text Generation
Transformers
Safetensors
laguna
laguna-s-2.1
vllm
conversational
custom_code
Eval Results
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)# pip install -U transformers accelerate # 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- 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
Strix Halo (Ryzen AI Max+ 395) results: 24–34 tok/s at 128K–245K, and DFlash that works past 8K
#43
by j2ipper - opened
Sharing results from running Laguna-S-2.1 on an AMD Strix Halo laptop (HP ZBook Ultra G1a, 128 GB, 70 W) with llama.cpp Vulkan, 262K context, q8_0 KV:
- Decode: 33–34 tok/s short context; 26.4 tok/s @128K and 24.2 @245K (19.5 / 15.0 before) with block-sparse decode attention on the 12 full-attention layers.
- Prefill: +23% @128K with KV-sliced flash attention; ub 4096 adds +7–11% at short context.
- DFlash at depth: the DFlash drafter attends to the whole context and its acceptance collapses as context grows (0.2% at 31K, the "DFlash breaks past 8K" reports). Giving the drafter a 1,024-token sliding window fixes it: code generation 40.6 / 37.5 / 34.0 / 34.9 tok/s at ~1K / 31K / 124K / 235K, with an adaptive pause keeping prose at normal speed.
- Quality: agentic coding suite 5/5, needle 15/15 (greedy). With thinking off the agentic suite ran in 727 s vs 1,632 s (needle 13/15 vs 14/15).
- Keep the GGUF's YaRN factor 32: the HF config's factor 128 was +6.8% worse in perplexity at 64K.
The sparse attention, KV slicing and drafter window are llama.cpp patches (published in the repo). Details, configs and method: https://github.com/nsbradley88/halo-tuning (laguna/)