PEFT
Safetensors
trl
grpo
async-grpo
lora
agents
harbor
openenv
pi

LFM3-1.7B · Harbor · pi (LoRA)

A LoRA adapter for LiquidAI/LFM3-1.7B, trained with reinforcement learning to work as the model behind the pi coding agent on data-analysis tasks.

Each training rollout is a full pi session in a remote sandbox: the agent reads the task, runs shell and Python tools against the task's data files, and answers. A verifier then grades the answer. The adapter was trained on those grades with TRL's asynchronous GRPO trainer.

In short: this checkpoint solves 10.7 points more tasks than the base model, with 37% fewer tool calls on the tasks both solve. On harder repository tasks rebuilt from real agent sessions (traj2envs), it is within noise of the base model (-2.5 ± 11.1 points).

Results

Evaluated with the pi harness, one attempt per task at temperature 0.8, paired against the base model on the same tasks. The interval is 95%; tool calls are compared on the tasks both solved.

Tasks n Base model This adapter (step 400) Difference (points) Tool calls
150 held-out tasks of FineEnvs/SmolDataEnvs-harbor-train 150 70.0% 80.7% +10.7 ± 6.7 -37% (99 tasks)
40 held-out tasks of harness-hub/traj2envs-rl 40 15.0% 12.5% -2.5 ± 11.1 -6% (3 tasks)

The main evaluation is the first row: 150 held-out tasks of FineEnvs/SmolDataEnvs-harbor-train (tasks 1,000 and up, easy and medium, none of them seen in training). Step 400 is the final checkpoint of the run.

Use with pi

1. Serve the adapter with vLLM

vllm serve LiquidAI/LFM3-1.7B \
    --enable-lora --max-lora-rank 32 \
    --lora-modules lfm3-harbor-pi=harness-hub/LFM3-1.7B-pi \
    --enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3 --trust-remote-code \
    --max-model-len 131072

This is the configuration used in training and evaluation.

LFM3 was not supported by a vLLM release when we trained. Training and evaluation used vLLM at commit fac2ce2eb3633c44a104a66dbb30d0e6c7f4493e with lfm3.py, registry.py and causal_conv1d.py taken from atmikshetty/vllm@5f67fbc. With a vLLM version that supports Lfm3ForCausalLM, the command above is all you need.

2. Point pi at it

Install pi (Node.js 22.19 or newer):

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Add the server to ~/.pi/agent/models.json:

{
  "providers": {
    "local": {
      "baseUrl": "http://localhost:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "models": [{ "id": "lfm3-harbor-pi" }]
    }
  }
}

"api": "openai-completions" matters: without it pi uses the Responses API, which this adapter was not trained or evaluated with.

pi --provider local --model lfm3-harbor-pi --print "Which region had the highest revenue growth in sales.csv?"

Use with llama.cpp

A GGUF version of this adapter is in harness-hub/LFM3-1.7B-pi-GGUF. It runs on top of a GGUF of the base model:

hf download LiquidAI/LFM3-1.7B-GGUF LFM3-1.7B-Q8_0.gguf --local-dir .
hf download harness-hub/LFM3-1.7B-pi-GGUF LFM3-1.7B-harbor-pi-lora-F16.gguf --local-dir .

llama serve -m LFM3-1.7B-Q8_0.gguf --lora LFM3-1.7B-harbor-pi-lora-F16.gguf \
    -c 65536 --port 8080 --alias lfm3-harbor-pi
pi install git:github.com/huggingface/pi-llama
pi --model llama-cpp/lfm3-harbor-pi

The GGUF version has not been re-evaluated.

Training

Method AsyncGRPO (TRL, experimental), LoRA
Environment Harbor tasks served by OpenEnv, rollouts in HF sandboxes, tool calls screened by safeagents
Harness pi
Tasks trained on, up to this checkpoint 550 SmolDataEnvs tasks and 230 traj2envs tasks
Reward the task verifier's correctness (falls back to reward), plus a tool-efficiency bonus of weight 0.1
Steps 400 (this checkpoint), of a 400-step run
Learning rate 1e-5
LoRA r = 32, alpha = 64, all linear layers
Rollouts 8 per task, temperature 0.8, up to 17 model calls and 600 s per rollout
Batch 4 micro-batches of up to 65,536 tokens per step, rollouts up to 4 policy versions stale
Hardware 2× NVIDIA H200 on HF Jobs: vLLM on one, the three trainers (one per harness) sharing the other

The training script is examples/async_grpo_harbor in TRL.

Limitations

  • Small evaluation. 150 tasks put the 95% interval on the paired pass@1 difference at ±6.7 points.
  • One task family. Training and the main evaluation are on data-analysis tasks. On the traj2envs repository tasks (second row), it does not improve on the base model.
  • One harness. The adapter was trained inside pi's prompts and tools. With another agent, expect it to behave like the base model, or worse.
Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for harness-hub/LFM3-1.7B-pi

Adapter
(19)
this model
Adapters
1 model

Datasets used to train harness-hub/LFM3-1.7B-pi

Collection including harness-hub/LFM3-1.7B-pi