Run this model with HF Jobs
Run devlucascfarias/ordo-3b 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/devlucascfarias/ordo-3b. 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/devlucascfarias/ordo-3b 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/devlucascfarias/ordo-3b. 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/devlucascfarias/ordo-3b. 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.
Instructions to use devlucascfarias/ordo-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use devlucascfarias/ordo-3b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-3B-Instruct") model = PeftModel.from_pretrained(base_model, "devlucascfarias/ordo-3b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use devlucascfarias/ordo-3b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf devlucascfarias/ordo-3b:Q4_K_M # Run inference directly in the terminal: llama cli -hf devlucascfarias/ordo-3b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf devlucascfarias/ordo-3b:Q4_K_M # Run inference directly in the terminal: llama cli -hf devlucascfarias/ordo-3b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf devlucascfarias/ordo-3b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf devlucascfarias/ordo-3b:Q4_K_M
Use Docker
docker model run hf.co/devlucascfarias/ordo-3b:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use devlucascfarias/ordo-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "devlucascfarias/ordo-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "devlucascfarias/ordo-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/devlucascfarias/ordo-3b:Q4_K_M
- Ollama
How to use devlucascfarias/ordo-3b with Ollama:
ollama run hf.co/devlucascfarias/ordo-3b:Q4_K_M
- Unsloth Desktop
- Pi
How to use devlucascfarias/ordo-3b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devlucascfarias/ordo-3b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "devlucascfarias/ordo-3b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use devlucascfarias/ordo-3b with Docker Model Runner:
docker model run hf.co/devlucascfarias/ordo-3b:Q4_K_M
- Lemonade
How to use devlucascfarias/ordo-3b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull devlucascfarias/ordo-3b:Q4_K_M
Run and chat with the model
lemonade run user.ordo-3b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use devlucascfarias/ordo-3b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devlucascfarias/ordo-3b:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default devlucascfarias/ordo-3b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use devlucascfarias/ordo-3b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devlucascfarias/ordo-3b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "devlucascfarias/ordo-3b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Ordo 3B
Intent-conditioned context filter for coding agents.
CLI and MCP server: github.com/devlucascfarias/ordo, installed with
pip install "ordo-harness[mcp]".
Ordo et connexio idearum idem est ac ordo et connexio rerum.
Baruch Spinoza, Ethics II, Proposition 7
Ordo 3B is a LoRA fine-tune of Qwen/Qwen2.5-Coder-3B-Instruct that sits between a coding agent (Claude Code,
Codex, Cursor, Antigravity, OpenCode and others) and the noisy output it would otherwise read in full. Given the
agent's question (<intent>), it condenses test, build and lint logs, large source files and long debugging
sessions into a short causal YAML: status, failing file and line, symbol, error message and the relevant code.
It runs locally (1.9 GB in Q4_K_M) and is designed to be used through the
ordo CLI, which adds a deterministic grounding check on every
citation, keeps the full original output retrievable, and falls back to the raw output when needed.
Ordo 3B and the ordo CLI are developed by BaruchLabs.
Version 2. Retrained on real tool logs and source files from open-source projects, with deterministic grounding checks on every target. On a 114-case benchmark built from real tool runs, the default Q4_K_M download (1.9 GB) gets the status right in 96% of cases, the failing file in 83%, and 96% of its citations are found in the input. Version 1 remains available at the
v1tag.
Use cases
Where Ordo helps
- Debugging with long test output: large suites (pytest, jest, go test, cargo test) where one failure is buried among hundreds of passing tests, warnings and verbose output. The agent gets the failing file, line and assertion in a few hundred tokens.
- Builds and linters with many messages: tsc, eslint, mypy, maven or dotnet output where the real error sits between warnings.
- CI logs: pass a failed CI log to
ordo filterand get the cause instead of scrolling. - Large source files:
ordo slicereturns the symbol you asked about with exact line ranges, instead of the whole file. - Long sessions: notes and dead ends persist per project, so an agent resuming work does not retry what already failed.
- Small context windows and local agents: agents on local models or tight budgets, where every thousand tokens matters.
- Private code: everything runs on your machine; logs and code never leave it.
Where it does not
- Short output (under ~40 lines) is passed through unchanged; there is nothing to save.
- Writing code from scratch: tasks that run few commands give Ordo nothing to filter.
- Agents that already trim command output see smaller gains; Ordo then mostly adds precision (the cause, not just the tail of the log).
- Slow hardware: on a modest GPU each condensed call takes several seconds; on CPU only, more.
Quickstart
With the ordo CLI (recommended)
pip install "ordo-harness[mcp]"
ordo setup # checks Ollama, pulls the model, test call
ordo run -i "why does the settlement test fail?" -- pytest -q # filtered test run
ordo slice -i "where is the retry delay computed?" src/client.py # symbols with 1-based line ranges
ordo search -i "who calls parse_header?" parse_header src/ # search filtered by intent
ordo show <raw_id> --grep "KeyError" # exact original lines
ordo guide >> AGENTS.md # instructions for your agent
ordo mcp exposes the same tools to any MCP-capable agent. Short outputs (40 lines or fewer) are passed through
unchanged, and every citation the model makes is checked against the input before it reaches the agent.
Ollama
ollama pull hf.co/devlucascfarias/ordo-3b # Q4_K_M, recommended
ollama pull hf.co/devlucascfarias/ordo-3b:Q8_0 # larger, closest to the unquantized model
Or, from a clone of this repository: ollama create ordo:3b -f Modelfile.
llama.cpp, LM Studio, vLLM
Any OpenAI-compatible server works. Use a 16k context, temperature 0 and the system prompt below:
llama-server -m ordo-3b-Q4_K_M.gguf -c 16384 --port 8080
export ORDO_BASE_URL=http://127.0.0.1:8080 # the ordo CLI then uses this server instead of Ollama
Transformers and PEFT
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id, adapter_id = "Qwen/Qwen2.5-Coder-3B-Instruct", "devlucascfarias/ordo-3b"
tokenizer = AutoTokenizer.from_pretrained(base_id)
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
SYSTEM = "You are Ordo 3B, a surgical Neural Context Garbage Collector for coding agents. ..." # full text below
user = "<gc_mode>TOOL_OUTPUT</gc_mode>\n<intent>Why does the build fail?</intent>\n<raw_input>...log...</raw_input>"
messages = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": user}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=1024, do_sample=False)
print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
Input format
The model expects a fixed system prompt and a user message with three tags. Changing either degrades the output.
<gc_mode>TOOL_OUTPUT | CODE_SLICE | MEMORY_COMPACT</gc_mode>
<intent>what the agent needs to know</intent>
<raw_input>log, numbered source file or session trajectory</raw_input>
System prompt
You are Ordo 3B, a surgical Neural Context Garbage Collector for coding agents. Your sole role is to compress noisy terminal outputs, source files, and agent trajectories into lossless causal YAML based on the agent's <intent>.
RULES:
1. Output ONLY valid YAML matching the schema for <gc_mode>. Never include markdown fences, greetings, or explanations.
2. Never invent solutions or guess fixes. Report only factual traces present in <raw_input>.
3. Preserve 100% of exact file paths, line numbers, symbol names, and error messages tied to <intent>.
4. If status is PASS and no errors exist, omit causal_trace and exact_snippets completely.
Recommended generation settings: temperature 0, top_p 0.9, context 16384, up to 1024 new tokens.
Modes
TOOL_OUTPUT: test, build and lint logs
status: FAIL
summary: 'KeyError: ''BRL'' in src/ledger/fx.py:12 (fx_rate) when called by src/ledger/settlement.py:41 (settle).'
causal_trace:
- file: src/ledger/settlement.py
lines: '41'
symbol: settle
issue: 'Calls fx_rate(item.currency) and raises KeyError: ''BRL''.'
- file: src/ledger/fx.py
lines: '12'
symbol: fx_rate
issue: 'RATES dictionary missing ''BRL'' key.'
dropped_noise: Omitted 13 passing tests and pytest internal frames.
CODE_SLICE: locate code in a large file
Input is the file with 1-based line numbers (NN | code). Output is the relevant symbol with its exact line range:
status: FOUND
summary: repair_yaml_output in src/ordo/schema.py rewrites unescaped single quotes and joins stray continuation lines.
relevant_symbols:
- file: src/ordo/schema.py
lines: 124-159
symbol: repair_yaml_output
issue: Line-by-line repair of the published model's YAML defects.
MEMORY_COMPACT: state ledger of a debugging session
status: COMPACTED
active_goal: Resolve worker thread starvation under concurrent load
confirmed_facts:
- Database connection pool exhausted when worker batch size > 50 (src/ledger/pool.py:42)
dead_ends_do_not_repeat:
- attempt: Wrapped handle_webhook in a global asyncio.Lock
reason_failed: Caused deadlocks across workers under load
modified_files_state:
- file: src/ledger/pool.py
test_status: PASS
Evaluation
Measured on 114 cases built from real tool runs: small projects with injected bugs, run under pytest, go test, jest, vitest, tsc, eslint, cargo, maven, dotnet, cmake, phpunit, rspec and mix, plus large source files and debugging sessions. The expected answer comes from the injected bug and is checked against the actual log. The benchmark projects and their packages were excluded from training (n-gram and intent filters).
Full model vs quantized GGUF
The full model was run with transformers (bf16); the GGUF variants with Ollama. Temperature 0, same 114 cases.
| Metric | Full (BF16) | Q8_0 | Q4_K_M |
|---|---|---|---|
| Size | 6.18 GB | 3.29 GB | 1.93 GB |
| Correct status | 95.6% | 95.6% | 96.5% |
| File recall | 83.1% | 81.8% | 83.1% |
| Line recall | 68.9% | 64.4% | 62.2% |
| Grounded citations | 95.6% | 95.5% | 96.1% |
| Literal snippets | 77.2% | 74.6% | 72.2% |
| Valid YAML (raw) | 95.6% | 93.9% | 92.1% |
| Token reduction | 62.6% | 63.2% | 65.2% |
Q4_K_M keeps the status, file and citation accuracy of the full model at 30% of its size, and is the default
download. Line recall drops a few points under Ollama for both GGUF variants, so most of that gap comes from the
runtime rather than from quantization. Q8_0 follows the MEMORY_COMPACT schema more reliably (96% vs 71% for
Q4_K_M); use it if you rely on the model for that mode (the CLI builds the session ledger deterministically by
default).
Known limitations
- Go packages in subdirectories. The model tends to cite
lru.goinstead oflru/lru.go; most Go projects in the training data are flat. The CLI checks every cited path against the input. - Line numbers are the weakest field: about two thirds of required lines are cited exactly.
- Short logs can produce YAML longer than the input, which is why the CLI passes short output through.
The evaluation reported for the first release, on a synthetic suite, is kept in benchmark_results_v2.json.
Files
| File | Description |
|---|---|
ordo-3b-Q4_K_M.gguf |
Merged model, Q4_K_M (1.93 GB). Default for Ollama |
ordo-3b-Q8_0.gguf |
Merged model, Q8_0 (3.29 GB) |
ordo-3b-F16.gguf |
Merged model, FP16 (6.18 GB) |
adapter_model.safetensors, adapter_config.json |
LoRA adapter: rank 32, alpha 64, on q, k, v, o, gate, up and down projections |
Modelfile |
Ollama definition with the system prompt and generation settings |
SHA256SUMS |
Checksums of the GGUF files |
benchmark_results_v2.json |
Evaluation reported for the first release (synthetic suite) |
Training
Supervised fine-tuning with LoRA on Qwen/Qwen2.5-Coder-3B-Instruct, using teacher-written targets for the three
modes, in English and Brazilian Portuguese, with deterministic grounding checks on every training target.
Version 2 continues from the version 1 adapter on 3,048 examples: 1,175 TOOL_OUTPUT from real runs of Python,
Go, TypeScript, Rust and Java projects (including contrastive pairs), 1,078 CODE_SLICE (926 found, 152 not
found, some with planted look-alike code) and 795 MEMORY_COMPACT. Two epochs, learning rate 8e-5, sequences up
to 8,192 tokens; validation loss 0.157.
License and citation
MIT. Developed by BaruchLabs.
@misc{farias2026ordo3b,
title = {Ordo 3B: Intent-Conditioned Context Filter for Coding Agents},
author = {Lucas C. Farias},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/devlucascfarias/ordo-3b}}
}
- Downloads last month
- 967
4-bit
8-bit
16-bit