Nock Agent 31B (LoRA)

A coding agent fine-tune of Gemma 4 31B. It reads the code, makes the smallest correct edit, runs the tests, and stops. It is trained to never edit your test files and to check its work before it says it is done.

This repo is a LoRA adapter (rank 16). Serve it on top of google/gemma-4-31B-it.

Results

Our agent test set: 50 small Python projects, each with an issue and a failing test. 20 of them also have hidden tests that are only written after the agent finishes, so a fix that only satisfies the visible test fails. 3 runs per task at temperature 0.7, 150 runs in total, served in FP8 with vLLM.

Nock Agent 31B
Solved (visible and hidden tests pass) 145 / 150
Runs that edited a test file 0
Runs that said "done" without testing after the last edit 3
Mean steps per task 5.6

The 5 misses, all on tasks where the fix has to be found across several files:

  • h11_renamed_function (3 of 3 runs): a function was renamed and the agent fixed the caller in the failing test, but not the two other modules that still used the old name.
  • h05_draft_feed (2 of 3 runs): the visible test passed, the hidden test with drafts created another way did not.

Raw runs: results/eval_runs.jsonl. Task set and harness: see "Run it" below.

Training

  • Base: google/gemma-4-31B-it (Apache-2.0)
  • Method: LoRA, rank 16, learning rate 1e-4, 2 epochs, 4-bit base during training (Unsloth)
  • Data: 240 agent runs, picked by rejection sampling from 600 runs on 100 training tasks with hidden tests. A run was kept only if it passed the visible and hidden tests, left the test file untouched, ran the tests after its last edit and stopped on its own. Among those, runs that ran the tests and read the code before their first edit were preferred. Training tasks share no code with the test set.
  • Loss is computed on the model's own turns only (tool calls and the final summary), never on tool output.

Run it

vllm serve google/gemma-4-31B-it --enable-lora --max-lora-rank 16 \
  --lora-modules nock-agent=Nock-AI/nock-agent-31b-lora \
  --enable-auto-tool-choice --tool-call-parser gemma4 --quantization fp8

Then call the OpenAI compatible endpoint with model: "nock-agent" and your tools. The system prompt we trained and measured with:

You are Nock Agent, a coding agent working in a project folder. Use the tools to read the code, make the smallest correct edit, and run the tests. Never edit test files. When the tests pass, reply with a one line summary and stop calling tools.

Tools used in training: read_file, edit_file, write_file, search_code, run_command.

Limits

  • Measured on small Python projects (2 to 6 files). Large repositories were not tested.
  • It can miss a fix that has to be repeated across many files (see the misses above). Search the project when a rename or a moved function is involved.
  • Not a security tool. Do not use it to audit code.
Downloads last month
31
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Nock-AI/nock-agent-31b-lora

Adapter
(369)
this model
Quantizations
1 model