Text Generation
Transformers
Safetensors
laguna
code
distillation
moe-to-dense
conversational
custom_code
Instructions to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="poolside-laguna-hackathon/laguna-xs2-dense-stage2", 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-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage2", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "poolside-laguna-hackathon/laguna-xs2-dense-stage2" # 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-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
- SGLang
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 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-hackathon/laguna-xs2-dense-stage2" \ --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-hackathon/laguna-xs2-dense-stage2", "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-hackathon/laguna-xs2-dense-stage2" \ --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-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Docker Model Runner:
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -47,13 +47,26 @@ print(tok.decode(m.generate(**ids, max_new_tokens=64)[0], skip_special_tokens=Tr
|
|
| 47 |
|
| 48 |
## Results
|
| 49 |
|
| 50 |
-
| Model | Params | Held-out PPL | HumanEval pass@1 |
|
| 51 |
|---|---|---|---|
|
| 52 |
| Teacher (Laguna XS.2, fp8) | 33B (3B active) | ~4.4 | _running_ |
|
| 53 |
| Stage-1 dense | ~3B | ~25 | _running_ |
|
| 54 |
-
| **Stage-2 dense (this)** | ~3B | _tbd_ |
|
| 55 |
|
| 56 |
-
_(HumanEval pass@1 via [evalplus](https://github.com/evalplus/evalplus)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
**Qualitative (honest):** still degenerate. Stage-1 emits non-Pythonic repetition (`return n;` ×∞); Stage-2 emits *valid* Python and the correct function structure but loops (`return 0` repeated). The KD moves it directionally toward coherent code — it just needs far more than 14M tokens.
|
| 59 |
|
|
|
|
| 47 |
|
| 48 |
## Results
|
| 49 |
|
| 50 |
+
| Model | Params (resident) | Held-out PPL | HumanEval pass@1 |
|
| 51 |
|---|---|---|---|
|
| 52 |
| Teacher (Laguna XS.2, fp8) | 33B (3B active) | ~4.4 | _running_ |
|
| 53 |
| Stage-1 dense | ~3B | ~25 | _running_ |
|
| 54 |
+
| **Stage-2 dense (this)** | ~3B | _tbd_ | **0.6%** (1/164) |
|
| 55 |
|
| 56 |
+
_(HumanEval pass@1 via [evalplus](https://github.com/evalplus/evalplus), greedy. Teacher + Stage-1 numbers being measured; will be filled in.)_
|
| 57 |
+
|
| 58 |
+
Stage-2's ~0.6% confirms the model is **not yet usable** for code generation — expected at this distillation budget. The value demonstrated here is the **architecture + footprint** (below) and the **directional** KL/quality improvement over Stage-1; closing the task-accuracy gap needs much more KD.
|
| 59 |
+
|
| 60 |
+
## VRAM / footprint
|
| 61 |
+
|
| 62 |
+
The MoE keeps all 33B params resident even though only ~3B are active per token; the dense model keeps only the ~3B.
|
| 63 |
+
|
| 64 |
+
| Model | Params resident | bf16 weights | fp8 weights |
|
| 65 |
+
|---|---|---|---|
|
| 66 |
+
| XS.2 (33B MoE) | 33.4 B | ~67 GB | ~34 GB |
|
| 67 |
+
| **XS.2-dense (stage_2)** | ~3.0 B | **~6 GB** | ~3 GB |
|
| 68 |
+
|
| 69 |
+
→ **~11× smaller weight footprint** (~61 GB saved, bf16). Caveats: attention is unchanged, so **KV-cache memory is identical** to the teacher (all savings are in the weights); per-token **FLOPs are ~unchanged** (the MoE was already ~3B-active) — the win is **memory/deployability**, not speed. XS.2 needs an 80 GB-class GPU (or fp8 on 48 GB); the dense model fits a 16 GB consumer GPU. _(The exported checkpoint here is zero-padded to ~3.8B / 7.7 GB for stock-modeling compat; the true model is 3.0B / ~6 GB.)_
|
| 70 |
|
| 71 |
**Qualitative (honest):** still degenerate. Stage-1 emits non-Pythonic repetition (`return n;` ×∞); Stage-2 emits *valid* Python and the correct function structure but loops (`return 0` repeated). The KD moves it directionally toward coherent code — it just needs far more than 14M tokens.
|
| 72 |
|