// a fine-tuning SDK — alpha

ShadowLM

Any open model —
with any method,
on any hardware,
for any harness.

Move one task off a rented frontier model and onto a small model you own — without touching the agent. It runs in the model's shadow until it does the job as well, then takes over. That's a shadowLM.

llama · qwen · mistral · gemma · phi · deepseek · olmo · mlx
Open source · maintained byKhush Patel&Shreyas Kapale@Lyzr
◢ MODEL.CORE
0x7F3A · BAYER 8×8
░░░░░ inference layer
↓ scroll
// §01 — the studio

Train it. Watch it. Talk to it.

One command — shadowlm serve — opens the studio on one port. The built React app ships in the wheel; the same JSON protocol powers backend="remote".

playground · base ↔ shadow127.0.0.1:8329
ShadowLM Studio — PlaygroundShadowLM Studio — TrainShadowLM Studio — RunsShadowLM Studio — Console

Talk to a shadow. The shadow recalls “Lyzr Cloud · $0.08 / agent run” — the base model has no idea.

// architecture

One SDK. Every layer.

Every orthogonal axis of ShadowLM, drawn out — model, method, hardware, harness, the shadow loop, the accelerator. Swipe through the full system.

Any model · method · hardware · harnessHigh-level architectureTwelve methods, one specThe shadow loopCapture → judge → trainThe shadow accelerator
01 / 06 · Any model · method · hardware · harness
// the thesis — a shadowLM

Run in the shadow.
Then take over.

ShadowLM is the engine for one move: migrate a single task from a frontier model you rent to a small model you own — the agent keeps calling the same endpoint, only the model behind it changes. The one-click orchestration is ShadowLM Studio; this SDK is the engine underneath it.

step 01

Baseline

Your agent runs on a rented frontier model — general, costly, someone else's.

step 02

Capture & fine-tune

slm.capture() records the real traffic. Train a small open model on it — judge whole episodes, then GRPO or DPO.

step 03

Shadow mode

The shadowLM runs behind the same agent, answering in parallel so you can compare it to the frontier model on live traffic.

step 04

Gradual switch

Once it holds up, route traffic to the shadowLM. Lower cost, data stays inside, the weights are yours.

// §02 — methods

Twelve methods.
One config.

Each technique is a declarative spec — backends read the spec (adapter kind, base requirements, data rendering), never the method name. Swap DPO for GRPO by changing a key. Stack a LoRA over a 4-bit base in three lines. Every method checkpoints; adding your own is one file.

01
LoRA
low-rank adaptation
02
QLoRA
4-bit quantized lora
03
DoRA
weight-decomposed lora
04
Full
update every weight
05
CPT
continued pretraining
06
DPO
direct preference opt.
07
GRPO
group relative policy
08
MoRE
mixture of retrieval experts
09
BitFit
train only bias terms
10
Prompt
soft virtual prompts
11
P-Tuning
encoded prompt embeds
12
Adapter
houlsby bottlenecks
// §03 — interface

Three lines.
Production run.

shadowlm@0.3.0
$ curl -fsSL https://install.shadowlm.sh | sh   # detect hw, install, open studio
# or with pip:
$ pip install 'shadowlm[all]'
$ shadowlm finetune data.jsonl \
    --model Qwen/Qwen2.5-0.5B-Instruct \
    --method lora --max-steps 120 --set save_steps=40 --eval 15%

  [shadow] enabled: gradient checkpointing
  [mlx:gpu] finetuning Qwen2.5-0.5B-Instruct-4bit · lora
           · 8 examples · 120 iters · r=16 on 24 layers · lr 2e-4
  [████████████████████████] step 120/120  loss 0.0718  11.7 st/s
  loss  ▇▆█▇▆▇▇█▅▅▄▅▃▃▁▂▂▂▁▁▁▁  4.2120 → 0.0718
  ♥ succeeded · 120 steps · checkpoints @ 40/80/120
1
pip install · batteries in
12
training methods
100%
local · your weights, your box
MIT
license