Text Generation
Transformers
Safetensors
laguna
code
distillation
moe-to-dense
conversational
custom_code
Instructions to use poolside-laguna-hackathon/laguna-xs2-dense-stage1 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-stage1 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-stage1", 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-stage1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage1", 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-stage1 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-stage1" # 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-stage1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage1
- SGLang
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage1 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-stage1" \ --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-stage1", "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-stage1" \ --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-stage1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage1 with Docker Model Runner:
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage1
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -12,9 +12,9 @@ pipeline_tag: text-generation
|
|
| 12 |
|
| 13 |
# Laguna-XS.2-dense (Stage 1)
|
| 14 |
|
| 15 |
-
The **Stage-1 init** for a dense distillation of **[poolside/Laguna-XS.2](https://huggingface.co/poolside/Laguna-XS.2)** (33B MoE,
|
| 16 |
|
| 17 |
-
> ⚠️ **Intermediate research artifact.** This is the *rough init* — cross-layer error compounding is deliberately **not** corrected here (that's Stage 2's job). Held-out perplexity
|
| 18 |
|
| 19 |
## Loading
|
| 20 |
|
|
@@ -26,6 +26,6 @@ m = AutoModelForCausalLM.from_pretrained("poolside-laguna-hackathon/laguna-xs2-d
|
|
| 26 |
tok = AutoTokenizer.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage1", trust_remote_code=True)
|
| 27 |
```
|
| 28 |
|
| 29 |
-
Dense FFNs (intermediate 4608) are zero-padded to 8192 so the **stock** `modeling_laguna.py` loads it (numerically identical); exported reports
|
| 30 |
|
| 31 |
See the [Stage-2 card](https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2) for the full method, results, and next steps. Code: https://github.com/postscarcity-inc/laguna-xs.2-dense
|
|
|
|
| 12 |
|
| 13 |
# Laguna-XS.2-dense (Stage 1)
|
| 14 |
|
| 15 |
+
The **Stage-1 init** for a dense distillation of **[poolside/Laguna-XS.2](https://huggingface.co/poolside/Laguna-XS.2)** (33B MoE, ≈3B active) into a **≈3B dense** model. Each of the 39 sparse MoE blocks is replaced by a single dense SwiGLU FFN (intermediate 4608) and trained **per-layer, in parallel** to match the teacher MoE block's output (RADLADS-style; teacher-fed inputs → no cross-layer error compounding). ≈90M tokens.
|
| 16 |
|
| 17 |
+
> ⚠️ **Intermediate research artifact.** This is the *rough init* — cross-layer error compounding is deliberately **not** corrected here (that's Stage 2's job). Held-out perplexity ≈25 (teacher ≈4.4); **HumanEval pass@1 = 0.0%**. Use **[laguna-xs2-dense-stage2](https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2)** (KD-recovered) as the more capable checkpoint.
|
| 18 |
|
| 19 |
## Loading
|
| 20 |
|
|
|
|
| 26 |
tok = AutoTokenizer.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage1", trust_remote_code=True)
|
| 27 |
```
|
| 28 |
|
| 29 |
+
Dense FFNs (intermediate 4608) are zero-padded to 8192 so the **stock** `modeling_laguna.py` loads it (numerically identical); exported reports ≈3.8B, true model ≈3.0B. `last.pt` (raw Stage-1 FFN weights) is also in this repo. **Footprint:** ≈6 GB bf16 vs ≈67 GB for the 33B MoE (≈11× less weight VRAM).
|
| 30 |
|
| 31 |
See the [Stage-2 card](https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2) for the full method, results, and next steps. Code: https://github.com/postscarcity-inc/laguna-xs.2-dense
|