Text Generation
Transformers
Safetensors
English
fuse3
mixture-of-experts
MoE
coding
python
code-generation
LFM2
Qwen
LiquidAI
small-language-model
SLM
agentic
fusion
expert-routing
5B
efficient-inference
conversational
custom_code
Eval Results (legacy)
Instructions to use Akahsizrr/fuse-1-Lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Akahsizrr/fuse-1-Lite with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Akahsizrr/fuse-1-Lite", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Akahsizrr/fuse-1-Lite", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Akahsizrr/fuse-1-Lite with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Akahsizrr/fuse-1-Lite" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Akahsizrr/fuse-1-Lite", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Akahsizrr/fuse-1-Lite
- SGLang
How to use Akahsizrr/fuse-1-Lite 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 "Akahsizrr/fuse-1-Lite" \ --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": "Akahsizrr/fuse-1-Lite", "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 "Akahsizrr/fuse-1-Lite" \ --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": "Akahsizrr/fuse-1-Lite", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Akahsizrr/fuse-1-Lite with Docker Model Runner:
docker model run hf.co/Akahsizrr/fuse-1-Lite
Add vLLM, MLX, and llama.cpp deployment docs with working implementations
Browse files
README.md
CHANGED
|
@@ -188,13 +188,16 @@ print(response)
|
|
| 188 |
|
| 189 |
### Pre-quantized Versions
|
| 190 |
|
| 191 |
-
| Version | Repo | VRAM | Format |
|
| 192 |
-
|---------|------|------|--------|
|
| 193 |
| **4-bit NF4** | [`Akahsizrr/fuse-1-Lite-4bit`](https://huggingface.co/Akahsizrr/fuse-1-Lite-4bit) | 3.36 GB | bitsandbytes |
|
| 194 |
| **8-bit** | [`Akahsizrr/fuse-1-Lite-8bit`](https://huggingface.co/Akahsizrr/fuse-1-Lite-8bit) | 6.00 GB | bitsandbytes |
|
| 195 |
| **bfloat16** | This repo | ~12 GB | safetensors |
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
-
### bitsandbytes 4-bit (NF4) —
|
| 198 |
|
| 199 |
```python
|
| 200 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
|
@@ -216,7 +219,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 216 |
tokenizer = AutoTokenizer.from_pretrained("Akahsizrr/fuse-1-Lite")
|
| 217 |
```
|
| 218 |
|
| 219 |
-
### bitsandbytes 8-bit —
|
| 220 |
|
| 221 |
```python
|
| 222 |
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
|
|
@@ -242,49 +245,93 @@ model.set_coding_enabled(False)
|
|
| 242 |
model.set_coding_enabled(True)
|
| 243 |
```
|
| 244 |
|
| 245 |
-
### vLLM
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
> which requires a custom vLLM model implementation. Use transformers for inference.
|
| 250 |
|
| 251 |
-
|
| 252 |
-
1. Write a custom vLLM model definition for `Fuse3ForCausalLM`
|
| 253 |
-
2. Register it with vLLM's model registry
|
| 254 |
-
3. Handle the hybrid conv+attention layers and expert routing
|
| 255 |
|
| 256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
|
| 258 |
### MLX (Apple Silicon)
|
| 259 |
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
|
| 264 |
```python
|
| 265 |
-
|
| 266 |
-
import torch
|
| 267 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 268 |
|
| 269 |
-
model =
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
)
|
| 275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
```
|
| 277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
### GGUF / llama.cpp
|
| 279 |
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
|
| 285 |
-
### Transformers (
|
| 286 |
|
| 287 |
-
The recommended way to run fuse-1 Lite
|
| 288 |
|
| 289 |
```bash
|
| 290 |
pip install transformers torch bitsandbytes accelerate
|
|
@@ -294,11 +341,15 @@ pip install transformers torch bitsandbytes accelerate
|
|
| 294 |
|
| 295 |
### VRAM Requirements
|
| 296 |
|
| 297 |
-
| Precision | VRAM | Recommended
|
| 298 |
-
|-----------|------|-----------------|
|
| 299 |
-
| bfloat16 | ~12 GB | L4, A10G, RTX 4090 |
|
| 300 |
-
| 8-bit |
|
| 301 |
-
| 4-bit |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
|
| 303 |
### Sample Outputs
|
| 304 |
|
|
|
|
| 188 |
|
| 189 |
### Pre-quantized Versions
|
| 190 |
|
| 191 |
+
| Version | Repo | VRAM/Memory | Format |
|
| 192 |
+
|---------|------|-------------|--------|
|
| 193 |
| **4-bit NF4** | [`Akahsizrr/fuse-1-Lite-4bit`](https://huggingface.co/Akahsizrr/fuse-1-Lite-4bit) | 3.36 GB | bitsandbytes |
|
| 194 |
| **8-bit** | [`Akahsizrr/fuse-1-Lite-8bit`](https://huggingface.co/Akahsizrr/fuse-1-Lite-8bit) | 6.00 GB | bitsandbytes |
|
| 195 |
| **bfloat16** | This repo | ~12 GB | safetensors |
|
| 196 |
+
| **MLX** | [`Akahsizrr/fuse-1-Lite-MLX`](https://huggingface.co/Akahsizrr/fuse-1-Lite-MLX) | ~12 GB | MLX safetensors |
|
| 197 |
+
| **GGUF F16** | [`Akahsizrr/fuse-1-Lite-GGUF`](https://huggingface.co/Akahsizrr/fuse-1-Lite-GGUF) | ~11.4 GB | GGUF |
|
| 198 |
+
| **vLLM plugin** | [`Akahsizrr/fuse-1-Lite-vLLM`](https://huggingface.co/Akahsizrr/fuse-1-Lite-vLLM) | ~12 GB | vLLM plugin |
|
| 199 |
|
| 200 |
+
### bitsandbytes 4-bit (NF4) — 3.36 GB VRAM
|
| 201 |
|
| 202 |
```python
|
| 203 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
|
|
|
| 219 |
tokenizer = AutoTokenizer.from_pretrained("Akahsizrr/fuse-1-Lite")
|
| 220 |
```
|
| 221 |
|
| 222 |
+
### bitsandbytes 8-bit — 6.00 GB VRAM
|
| 223 |
|
| 224 |
```python
|
| 225 |
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
|
|
|
|
| 245 |
model.set_coding_enabled(True)
|
| 246 |
```
|
| 247 |
|
| 248 |
+
### vLLM — High-Throughput Serving
|
| 249 |
|
| 250 |
+
fuse-1 Lite is supported in vLLM via a plugin that extends vLLM's native LFM2
|
| 251 |
+
implementation with expert augmentation layers.
|
|
|
|
| 252 |
|
| 253 |
+
**Plugin repo**: [`Akahsizrr/fuse-1-Lite-vLLM`](https://huggingface.co/Akahsizrr/fuse-1-Lite-vLLM)
|
|
|
|
|
|
|
|
|
|
| 254 |
|
| 255 |
+
```bash
|
| 256 |
+
# Install the plugin
|
| 257 |
+
pip install git+https://huggingface.co/Akahsizrr/fuse-1-Lite-vLLM
|
| 258 |
+
|
| 259 |
+
# Serve with vLLM
|
| 260 |
+
vllm serve Akahsizrr/fuse-1-Lite \
|
| 261 |
+
--mamba-cache-mode align \
|
| 262 |
+
--max-model-len 4096
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
```python
|
| 266 |
+
from vllm import LLM
|
| 267 |
+
|
| 268 |
+
llm = LLM(
|
| 269 |
+
model="Akahsizrr/fuse-1-Lite",
|
| 270 |
+
mamba_cache_mode="align",
|
| 271 |
+
max_model_len=4096,
|
| 272 |
+
)
|
| 273 |
+
output = llm.generate("Write a Python function to check if a number is prime.")
|
| 274 |
+
```
|
| 275 |
+
|
| 276 |
+
The plugin registers `Fuse3ForCausalLM` with vLLM's `ModelRegistry` via the
|
| 277 |
+
`vllm.general_plugins` entry point. It reuses vLLM's native LFM2 attention
|
| 278 |
+
and short-conv layers, adding the expert MoE block after each augmented
|
| 279 |
+
layer's FFN.
|
| 280 |
|
| 281 |
### MLX (Apple Silicon)
|
| 282 |
|
| 283 |
+
fuse-1 Lite is available in MLX format for Apple Silicon (M1+).
|
| 284 |
+
|
| 285 |
+
**MLX repo**: [`Akahsizrr/fuse-1-Lite-MLX`](https://huggingface.co/Akahsizrr/fuse-1-Lite-MLX)
|
| 286 |
|
| 287 |
```python
|
| 288 |
+
from mlx_lm import load, generate
|
|
|
|
|
|
|
| 289 |
|
| 290 |
+
model, tokenizer = load("Akahsizrr/fuse-1-Lite-MLX", trust_remote_code=True)
|
| 291 |
+
|
| 292 |
+
prompt = tokenizer.apply_chat_template(
|
| 293 |
+
[{"role": "user", "content": "Write a Python function to check if a number is prime."}],
|
| 294 |
+
tokenize=False, add_generation_prompt=True,
|
| 295 |
)
|
| 296 |
+
|
| 297 |
+
response = generate(model, tokenizer, prompt=prompt, max_tokens=512)
|
| 298 |
+
print(response)
|
| 299 |
+
```
|
| 300 |
+
|
| 301 |
+
```bash
|
| 302 |
+
# CLI
|
| 303 |
+
mlx_lm.generate --model Akahsizrr/fuse-1-Lite-MLX --trust-remote-code --prompt "Write a Python fizzbuzz"
|
| 304 |
```
|
| 305 |
|
| 306 |
+
The MLX model file (`fuse3_mlx.py`) extends MLX's native LFM2 implementation
|
| 307 |
+
with the same expert MoE augmentation. It uses `model_file` in config.json
|
| 308 |
+
with `trust_remote_code=True` for loading.
|
| 309 |
+
|
| 310 |
### GGUF / llama.cpp
|
| 311 |
|
| 312 |
+
fuse-1 Lite is available in GGUF format for llama.cpp.
|
| 313 |
+
|
| 314 |
+
**GGUF repo**: [`Akahsizrr/fuse-1-Lite-GGUF`](https://huggingface.co/Akahsizrr/fuse-1-Lite-GGUF)
|
| 315 |
+
|
| 316 |
+
> **Note:** The GGUF uses the custom `fuse3` architecture. Stock llama.cpp
|
| 317 |
+
> cannot load it — you need a llama.cpp fork with Fuse3 support. The GGUF
|
| 318 |
+
> repo includes the C++ graph builder (`src/models/fuse3.cpp`), Python
|
| 319 |
+
> converter (`conversion/fuse3.py`), and integration guide (`INTEGRATION.md`).
|
| 320 |
+
|
| 321 |
+
```bash
|
| 322 |
+
# Build llama.cpp with Fuse3 support (see INTEGRATION.md in the GGUF repo)
|
| 323 |
+
./llama-cli -m fuse-1-Lite-f16.gguf \
|
| 324 |
+
-p "Write a Python function to check if a number is prime." \
|
| 325 |
+
-n 512 --temp 0.1
|
| 326 |
+
```
|
| 327 |
+
|
| 328 |
+
The C++ implementation reuses LFM2's attention and short-conv graph builders,
|
| 329 |
+
adding the expert MoE block (router → top-k → SwiGLU experts → scale → add)
|
| 330 |
+
after each augmented layer's dense FFN.
|
| 331 |
|
| 332 |
+
### Transformers (Universal)
|
| 333 |
|
| 334 |
+
The recommended way to run fuse-1 Lite on any platform:
|
| 335 |
|
| 336 |
```bash
|
| 337 |
pip install transformers torch bitsandbytes accelerate
|
|
|
|
| 341 |
|
| 342 |
### VRAM Requirements
|
| 343 |
|
| 344 |
+
| Backend | Precision | VRAM/Memory | Recommended Hardware |
|
| 345 |
+
|---------|-----------|-------------|---------------------|
|
| 346 |
+
| Transformers | bfloat16 | ~12 GB | L4, A10G, RTX 4090 |
|
| 347 |
+
| Transformers | 8-bit | 6.00 GB | T4, L4, RTX 3060 |
|
| 348 |
+
| Transformers | 4-bit | 3.36 GB | T4, RTX 3060, M2 Pro |
|
| 349 |
+
| vLLM | bfloat16 | ~12 GB | A10G, A100, H100 |
|
| 350 |
+
| MLX | float16 | ~12 GB | M1 Pro+, M2, M3, M4 |
|
| 351 |
+
| llama.cpp | F16 | ~11.4 GB | Any CPU/GPU |
|
| 352 |
+
| llama.cpp | Q4_K_M | ~4 GB | Any CPU/GPU |
|
| 353 |
|
| 354 |
### Sample Outputs
|
| 355 |
|