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 — use Write directly
  • 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
Safetensors
Model size
0.3B params
Tensor type
BF16
·
U32
·
F32
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Ilides/Spartan-1.3-2B-MLX-8bit

Finetuned
Qwen/Qwen3.5-2B
Quantized
(2)
this model