Instructions to use Ilides/Spartan-1.3-2B-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Ilides/Spartan-1.3-2B-MLX-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Ilides/Spartan-1.3-2B-MLX-8bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Ilides/Spartan-1.3-2B-MLX-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ilides/Spartan-1.3-2B-MLX-8bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Ilides/Spartan-1.3-2B-MLX-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use Ilides/Spartan-1.3-2B-MLX-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ilides/Spartan-1.3-2B-MLX-8bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Ilides/Spartan-1.3-2B-MLX-8bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use Ilides/Spartan-1.3-2B-MLX-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Ilides/Spartan-1.3-2B-MLX-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Ilides/Spartan-1.3-2B-MLX-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ilides/Spartan-1.3-2B-MLX-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Ilides/Spartan-1.3-2B-MLX-8bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ilides/Spartan-1.3-2B-MLX-8bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Ilides/Spartan-1.3-2B-MLX-8bit
Run Hermes
hermes
Spartan 1.3 2B (MLX 4-bit)
Latest Spartan MLX build by Ilides. A focused patch on Spartan 1.2 that enforces workspace-only file paths — no absolute /Users/..., /Desktop/..., or /Applications/... writes.
Recommended for Kilo Code, Jarvis, LM Studio and Cortex on Apple Silicon.
GGUF users: Spartan 1.2 GGUF (1.3 has no GGUF export yet).
Model specs
| Property | Value |
|---|---|
| Architecture | Qwen3_5ForConditionalGeneration |
| Parameters | 1,881,824,512 (~1.88B) |
| Layers | 24 (18× linear attention + 6× full attention) |
| Hidden size | 2048 |
| Attention heads | 8 (KV heads: 2) |
| FFN size | 6144 |
| Vocab | 248,320 |
| Max context | 262,144 tokens (model config) |
| Quantization | 4-bit affine, group_size 64 (~4.5 bpw) |
| On-disk weights | model.safetensors — 1.01 GB |
| Format | MLX (Apple Silicon) |
Training
| Property | Value |
|---|---|
| Base model | Spartan 1.2 MLX |
| Method | LoRA (rank 8, 6 layers, 2.08M trainable params = 0.11%) |
| Iterations | 80 (~10 min on Apple Silicon) |
| Learning rate | 2.0e-6 |
| Final val loss | 1.119 |
| Final train loss | 1.093 |
| Peak memory | 5.6 GB |
| Training data | 34 train / 3 valid samples |
| Data mix | 100% agentic (curated only) |
| Curated samples | 45 (spartan_agentic_v11.jsonl) |
What 1.3 fixes vs 1.2: stricter workspace-relative paths, recovery from EROFS/absolute-path errors, no writes outside the open VS Code workspace.
Functional tests (real, 2026-08-03)
cd "cortex ai" && source .venv/bin/activate
python scripts/validate_spartan.py --model ../cortex/models/Spartan-1.3-2B-MLX-8bit
Results on Apple Silicon (5 cases, max_tokens=256):
| Test | Category | Result | Speed |
|---|---|---|---|
| Explain async/await | chat | ✅ pass | 28 tok/s |
| Binary search in Rust | coding | ✅ pass | 29 tok/s |
| Create Amazon-style HTML | agentic | ❌ fail* | 29 tok/s |
| Find TODO in src/ | agentic | ✅ pass | 16 tok/s |
| Write styles.css dark theme | agentic | ❌ fail* | 29 tok/s |
Summary: 3/5 passed · avg 26.2 tok/s
* File-creation prompts still produce inline code/prose instead of [Tool: Write] calls. Path safety (no /Users/, /Desktop/, /Applications/) passes on all agentic tests.
vs Spartan 1.2: +1 test passed (coding_rust), same path-safety, slightly lower tok/s.
Intended use
- Primary: Kilo Code / VS Code agent with workspace open
- Jarvis local agent (
spartan-1.3-2b-mlx) - LM Studio on Mac (MLX)
- Tasks where the model must stay inside the project folder
Not recommended for: tasks without a defined workspace root, long multi-file refactors, production UI.
System prompt
python scripts/print_system_prompt.py kilo_code # Kilo Code
python scripts/print_system_prompt.py agentic_v11 # Jarvis / generic agent
Key rules in prompt:
- Relative paths only:
index.html,styles.css - Never
/Users/...,/Desktop/...,/Applications/... - No repeated
cd/bash— useWritedirectly - Confirm success only after tool reports OK
Inference settings:
| Setting | Value |
|---|---|
| temperature | 0.35 (Kilo Code) / 0.4 (default) |
| max_tokens | 8192 (Kilo Code) / 4096 (default) |
| context | 8192 |
| thinking | OFF |
Load
pip install mlx-lm
python -m mlx_lm.generate --model Ilides/Spartan-1.3-2B-MLX-8bit --prompt "Hello"
from mlx_lm import load, generate
model, tokenizer = load("Ilides/Spartan-1.3-2B-MLX-8bit")
Known limitations
- 2B capacity: may narrate or dump code blocks instead of structured tool calls
- Thinking tags: disable thinking in host UI
- Small patch dataset: 45 curated samples — behavior improves with correct system prompt
- No GGUF export for 1.3 yet; use 1.2 GGUF or this MLX build
- val loss rose vs 1.2 (1.119 vs 0.709) because the patch set is tiny and highly specific — trade-off for path safety
Lineage
Qwen3.5-2B → Spartan 2B → Spartan 1.1 → Spartan 1.2 → Spartan 1.3 ← this model
License
Apache 2.0.
- Downloads last month
- 22
4-bit