Lyzr Research LabsShadowLM
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.
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".




Talk to a shadow. The shadow recalls “Lyzr Cloud · $0.08 / agent run” — the base model has no idea.
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.






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.
Baseline
Your agent runs on a rented frontier model — general, costly, someone else's.
Capture & fine-tune
slm.capture() records the real traffic. Train a small open model on it — judge whole episodes, then GRPO or DPO.
Shadow mode
The shadowLM runs behind the same agent, answering in parallel so you can compare it to the frontier model on live traffic.
Gradual switch
Once it holds up, route traffic to the shadowLM. Lower cost, data stays inside, the weights are yours.
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.
Three lines.
Production run.
$ 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