Run this model with HF Jobs

Run rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Inkling-2-Mini — Hermes Agent Pure-RL Champion (BF16 LoRA)

TL;DR: A fully autonomously trained, pure Reinforcement Learning (RL-only, zero SFT, zero LLM judges) attention-only LoRA (r=32, alpha=64, 17.50M trainable parameters — 0.066% of 26.4B total / 0.51% of 3.4B active weights, 33.41 MiB BF16) that turns thinkingmachines/Inkling-2-Mini into a fast, disciplined, parallel native tool user for Nous Research's Hermes Agent.


1. Plain-English Overview: What Changed?

Out of the box, Inkling-2-Mini is a strong coding model, but when wired into Hermes Agent it defaults to brittle "bash-everything" habits:

  • Instead of calling Hermes's structured file and editing tools (read_file, search_files, patch, write_file), the base model shells out to terminal (cat, sed, grep, python -c, heredocs) on >80% of file operations.
  • It inspects files sequentially one turn at a time rather than batching independent reads and searches in parallel.
  • It occasionally emits malformed tool arguments (e.g., missing path fields in patch calls) or burns tokens repeating failed shell commands.

Using 100% pure online multi-turn RL inside isolated Docker sandboxes with strictly verifiable rewards, we trained only the model's attention layers (0.066% of total parameters) to:

  1. Use Hermes's native tools by default (read_file, search_files, patch, write_file), saving terminal for running tests, builds, git, and commands that genuinely require a shell.
  2. Batch independent tool calls in parallel, cutting round-trips and wall-clock latency by 21–50%.
  3. Recover cleanly from test and tool errors instead of looping or hallucinating fixes.
  4. Stay concise on solved tasks, cutting output tokens by 25–56% across both multi-file suites and real-world GitHub repositories.

Fully Autonomous End-to-End Training

This entire model was designed, trained, debugged, audited, and benchmarked autonomously by a coordinated multi-agent swarm — including procedural Docker environment design, multi-stage curriculum evolution, reward shaping, 8 rounds of independent adversarial code/eval reviews, controlled 1-variable ablations (DAPO vs GSPO, learning rate, Python/JS upweighting, per-turn token budget, and pass-gated efficiency polish), checkpoint selection, and external Harbor benchmarking — with zero human-written SFT demonstrations and zero external LLM judges.


2. Mechanisms (How It Works)

Pure-RL Attention-Only LoRA (0.066% Trainable Parameters)

  • LoRA Scope: PEFT LoRA (r=32, alpha=64, BF16) targeting only the 120 attention projections across all 24 layers (q_proj.linear, k_proj.linear, v_proj.linear, o_proj.linear, and o_proj.gate_proj = 17,498,112 trainable parameters, 0.066% of 26.4B total / 0.51% of 3.4B active, 33.41 MiB).
  • Frozen MoE Experts & Router: Zero of the 128 routed MoE experts and zero router or MTP weights were modified. Restricting RL updates to attention acts as a strong structural regularizer — reshaping how the model plans and invokes tools while preserving underlying coding knowledge and native NVFP4 precision.

Online Multi-Turn GSPO Loop

  • Policy Optimization: GSPO (Group Sequence Policy Optimization, sequence-level importance clipping eps_low=0.004, eps_high=0.006) decisively outperformed token-level DAPO in controlled ablations (75% vs 26% native discipline on held-out checks).
  • Strict Tool-Observation Masking: Loss and KL gradients are computed strictly on assistant tokens; all sandbox tool outputs are masked out.
  • Zero-Extra-VRAM Reference KL: Computed via peft.disable_adapter() (beta=0.001–0.0025) with dynamic zero-std filtering (min_reward_std=0.025–0.05).
  • Single-GPU Sleep/Wake Hot-Swap: A colocated vLLM server wakes up, hot-loads the updated 33 MiB LoRA in <1s to generate 64 multi-turn Docker rollouts (max_turns=10, 896 tokens/turn), sleeps to free VRAM while PyTorch applies the GSPO step, and repeats.

Five Verifiable Reward Components (Zero LLM Judges)

  1. Verifiable Test Execution: Air-gapped Docker test suites with post-rollout SHA-256 anti-tamper verification of immutable test files and baseline-gated partial credit (zero bonus for non-improving edits).
  2. Native Hermes Tool Discipline: Rewards structured read_file / search_files / patch / write_file usage and penalizes raw terminal shell antipatterns (cat, sed, grep, heredocs).
  3. Schema & Format Validity: Per-call penalties for malformed JSON tool arguments (e.g., missing patch.path).
  4. Error Recovery: Credits trajectories that diagnose and recover cleanly from failing tool calls or tests.
  5. Pass-Gated Efficiency Polish (Stage 4B): Rewards concise turn counts and token budgets strictly gated on clean passing execution, preventing reward hacking via premature stops.

3. Compute Used & Training Lineage

  • Cloud GPU Hardware: Single-GPU cloud NVIDIA RTX PRO 6000 Blackwell Server Edition (96 GB VRAM) instances (up to 2 parallel instances during controlled 2-arm ablations).
  • Direct Reproducible Champion Path (100 cumulative GSPO steps, 6,400 online multi-turn rollouts):
    • Stage 2B — Core Hermes tool discipline (20 steps): ~4.1 GPU-hours
    • Stage 3B — Polyglot hard multi-file engineering & recovery (40 steps): ~9.4 GPU-hours
    • Stage 4A (lr=6e-6, max_turns=10, JS/Python upweight, 15 steps): ~3.4 GPU-hours
    • Stage 4A (py3x branch, 3× Python / 2× JS, 896 tok/turn unlock, 15 steps): ~3.5 GPU-hours
    • Stage 4B — Pass-gated efficiency polish (75/25 replay, 10 steps): ~2.4 GPU-hours
    • Direct Champion Path Total: ~23 GPU-hours on 1× NVIDIA RTX PRO 6000 Blackwell (96 GB).
  • Full Autonomous R&D Training Campaign (including Stage 1 baseline + controlled DAPO/GSPO, LR, and efficiency-polish ablations): ~67.9 GPU-hours (~38h wall-clock across up to 2 parallel GPUs).
  • Total End-to-End Cloud GPU Compute (full training campaign + all external Harbor 420-trial & multi-seed 400-rollout evaluations): ~91.2 GPU-hours.

4. Results — What It Improves

A. External Real-World Code Editing: SWE-bench Pro V2 Hard-51 (51 × 3 = 153 Trials, 100% Coverage)

Evaluated end-to-end via Harbor (scaleapi/SWE-bench_Pro-os) with Hermes Agent in air-gapped Docker (131K context, effort=none, temp=0.8, top_p=1.0, 1800s cap, 0 infra exceptions) on 16-bit vLLM against Stage 0 Base and Hugging Face's B300-trained harness-hub inkling-hermes (checkpoint-80):

Model (16-bit vLLM, effort=none, 30m cap) Pass@1 (51/51) Hermes Discipline Anti / Task Parallel Terminal Share Avg Calls (Solved) Avg Output Tok (Solved) Avg Wall Time
Stage 0 Base (Inkling-2-Mini) 45.1% (23/51) 21.1% 23.53 1.4% 82.9% 49.0 21,446 638.1s
HF harness-hub ckpt-80 (B300) 49.0% (25/51) 19.2% 24.35 1.5% 84.2% 43.0 20,161 660.6s
Our Champion (stage4b-eff-10) 52.9% (27/51) 92.3% 2.43 6.0% 21.3% 38.5 10,256 502.0s
  • Paired outcomes (n = 51 common graded set):
    • vs Base: +7.8 pp (9 wins / 5 losses / 18 both-pass, 95% CI [-5.9, +21.6] pp, McNemar p=0.424), +71.2 pp Hermes discipline, 10× fewer shell antipatterns, -28.8% tool calls & -55.6% output tokens on jointly-solved tasks (n=18), and -21.3% faster wall time.
    • vs HF B300 ckpt-80: +3.9 pp (6 wins / 4 losses / 21 both-pass, 95% CI [-7.8, +15.7] pp, McNemar p=0.754), +73.1 pp Hermes discipline, 10× fewer antipatterns, -17.9% tool calls & -54.0% output tokens on jointly-solved tasks (n=21), and -24.0% faster wall time.
  • (Methodology note: absolute pass rates here differ from harness-hub/Inkling-2-Mini-pi-adapted's 66.7% → 70.6% because that evaluation used the pi harness at reasoning effort high with a 2-hour per-task cap, whereas this 3-way run used Hermes Agent at effort=none with a 30-minute cap — compare models only within matched harness and budget.)

B. Multi-Seed High-Power Hermes Suites (--k 4 @ temp=0.6, 400 Rollouts, 16-bit vLLM, Default Effort)

Suite & Model mean_pass@1 pass@4 pass^4 (4/4) Discipline Anti / Rollout Parallel Recovery Avg Latency Joint-Pass Output Tok
frontier_20 — Base (80 rollouts) 82.5% (66/80) 90.0% 70.0% 41.1% 4.450 10.7% 61.4% 68.6s 252,120 (n=62)
frontier_20 — Champion 88.8% (71/80) (+6.3 pp) 95.0% 80.0% (+10 pp) 95.4% (+54.4 pp) 0.638 (-85.7%) 35.5% (3.3×) 85.1% (+23.8 pp) 49.2s (-28.3%) 175,972 (-30.2%)
Held-Out blind_30 — Base (120 rollouts, agg) 98.3% (118/120) 100.0% 93.3% 28.1% 1.942 4.5% 96.1% 14.9s 72,757 (n=115)
Held-Out blind_30 — Champion (agg) 97.5% (117/120) (tied, p=1.0) 100.0% 93.3% 97.0% (+68.9 pp) 0.125 (-93.6%) 21.0% (4.7×) 94.7% 14.1s 54,772 (-24.7%)

C. Single-Seed & Out-of-Distribution Hermes Suites

Benchmark Suite Runtime Stage 0 Base HF ckpt-80 (B300) Our Champion (stage4b-eff-10) Key Gain vs Base
frontier_20 (seed 42, default effort) 16-bit vLLM 70.0% (14/20) 75.0% (15/20) 90.0% (18/20) +20.0 pp pass · 96.4% disc · 36.3% parallel · 94.7% recovery
hard_dev_16 (Hermes discipline & patch) 16-bit vLLM 100.0% (16/16) 100.0% (16/16) 100.0% (16/16) 99.0% disc (100.0% at effort=none, 0 anti) · 100.0% valid
OOD sec_audit_12 (12 unseen defensive code-audit repos) 4-bit MLX oQ4e-mtp 75.0% (9/12) 75.0% (9/12) 83.3% (10/12) +8.3 pp pass · 100.0% disc (0 anti!) · 44.0% parallel (7.6× HF) · -37.9% wall
Held-Out blind_30 (aggregate-only) 4-bit MLX oQ4e-mtp 96.7% (29/30) 96.7% (29/30) 100.0% (30/30) Only 100% sweep · 99.1% disc (+79.9 pp) · -25% output tok vs HF · -50% wall vs Base

5. What Got Worse & Known Tradeoffs

  1. Open-Ended Linux/Sysadmin CLI Benchmarks at effort=none (Terminal-Bench 2.1):
    • On Terminal-Bench 2.1 (89 × 3 = 267 trials, effort=none, temp=0.8, 1200s cap, 16-bit vLLM):
      • Stage 0 Base: 47.2% (42/89) (22 timeouts, 11.0% discipline, 531.0s avg wall)
      • HF ckpt-80 (B300): 46.6% (41/88) (16 timeouts, 9.7% discipline, 469.0s avg wall, 1 verifier timeout)
      • Our Champion: 39.3% (35/89) (-7.9 pp vs Base, 95% CI [-15.7, +0.0] pp, paired McNemar p=0.092, n.s. at p<0.05)
    • Why it got worse: We explicitly trained the model away from bash-first shell strategies in favor of structured Hermes file/patch tools, and our RL curriculum used non-zero reasoning effort (0% effort=none coverage), making effort=none plans overly terse on exploratory non-coding CLI puzzles.
    • Efficiency tradeoff on TB 2.1: Even where pass rate dropped, timeouts fell -45% (22 → 12), jointly-solved output tokens fell -41.3% vs Base (-22.3% vs HF), average wall time fell -21.8%, and Hermes discipline jumped +58.2 pp (11.0% → 69.2%).
  2. Reasoning Effort Setting:
    • Tool discipline stays at 92–100% at effort=none (and it still wins SWE-bench Pro V2 Hard-51), but complex open-ended tasks perform best with default reasoning effort enabled.
  3. Best-Fit Scope:
    • Purpose-built for Hermes Agent software engineering, multi-file editing, debugging, and code auditing. For pure free-form Linux/bash administration without Hermes file/patch tools, use the unmodified base model (or serve both simultaneously via vLLM multi-LoRA and select per request).

6. Usage (PEFT & vLLM Multi-LoRA)

Loading with PEFT

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_id = "thinkingmachines/Inkling-2-Mini"
adapter_id = "rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
model = AutoModelForCausalLM.from_pretrained(base_id, dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)

Serving Alongside Base in vLLM (--enable-lora)

Note on Inkling-2-Mini LoRA key names in vLLM: HF PEFT saves attention keys under model.language_model.layers.*.self_attn.{q,k,v,o}_proj.linear and o_proj.gate_proj, whereas vLLM's native Inkling-2-Mini implementation expects model.llm.layers.*.attn.{wq_du,wk_dv,wv_dv,wo_ud,gate_attn} (with target_modules set to ["gate_attn", "wk_dv", "wo_ud", "wq_du", "wv_dv"]). After remapping those key names in adapter_model.safetensors:

python -m vllm.entrypoints.openai.api_server \
  --model thinkingmachines/Inkling-2-Mini \
  --max-model-len 131072 \
  --kv-cache-dtype fp8 \
  --enable-prefix-caching \
  --reasoning-parser inkling \
  --tool-call-parser inkling \
  --enable-auto-tool-choice \
  --enable-lora \
  --max-lora-rank 32 \
  --lora-modules hermes-rl=./remapped-adapter-dir

Then select "model": "hermes-rl" or "model": "thinkingmachines/Inkling-2-Mini" per OpenAI /v1/chat/completions request on the same GPU.


Repository Contents

Clean release containing only the final crowned Champion BF16 LoRA (stage4b_eff/checkpoint-10, 33.41 MiB):

  • adapter_model.safetensors & adapter_config.json — PEFT BF16 attention-only LoRA (r=32, alpha=64)
  • tokenizer.json, tokenizer_config.json, chat_template.jinja, processor_config.json — Tokenizer & chat template
  • champion_manifest.json & SHA256SUMS.txt — Provenance & cryptographic checksums
Downloads last month
37
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for rdsm/inkling_hermes_tune-inkling-2-mini-rl-lora

Adapter
(108)
this model