ColGrep-Agent-2B
is a lightweight code-localization agent designed to identify the files and line ranges relevant to a GitHub issue, bug report, feature request, or natural-language question about a repository.
Given a question such as
"Where are retries configured?"
or
"Why does the export crash on empty files?"
, the agent iteratively searches the repository using
ColGrep
, reads candidate files through a read-only terminal, and returns the precise code locations relevant to the task.
The model powers
colgrep --agent
and is designed to
offload repository exploration from larger coding agents
. Rather than consuming thousands of tokens searching through files before making a fix, a larger model can delegate code localization to ColGrep-Agent-2B and receive a focused list of relevant locations.
Its small footprint enables practical local inference, with GPU acceleration when available, without requiring Python, a separate inference server, or an API key.
The
colgrep --install-agent
command downloads the default
colgrep-agent-2B-Q8_0.gguf
model (approximately 2.5 GB), verifies that it loads, and prepares the prompt cache to accelerate the first inference.
Installation is required only once. No Python environment, external inference server, or API key is necessary.
2. Index a repository
cd /path/to/project
colgrep init
After the initial indexing, subsequent searches automatically detect modified files and update the index before answering.
3. Ask a question
colgrep --agent "where does the agent decide which GPU backend llama.cpp uses"
The following example shows a real session on ColGrep's own source code, running on an M3 Pro with Metal acceleration. Individual tool results have been omitted for readability.
The output follows the
path/to/file:START-END
format, making it directly usable by developers, scripts, and other coding agents.
Agent progress is printed to
stderr only when running in a terminal
, while stdout contains only the resulting code locations. This separation makes the command easy to compose with other tools.
Additional usage examples
Scope the search to a directory and display the matching code lines:
colgrep --agent "crash when the config file is empty" ./backend -c
Return structured JSON for downstream applications:
colgrep --agent --json "where are retries configured"
🤖 Integration with coding agents
ColGrep can be integrated into existing coding-agent workflows, allowing larger models to delegate repository exploration to a smaller specialized model.
For example, once configured, Claude Code can delegate open-ended questions such as
"Where is this behavior implemented?"
to
colgrep --agent
, receiving exact file paths and line ranges instead of performing every exploratory search itself.
This division of labor allows larger coding agents to reserve more of their context and computation for understanding issues, planning changes, and generating patches.
🔎 ColGrep
ColGrep
is a semantic code search tool for terminals and coding agents, built on the NextPlaid search engine. It combines natural-language search with regex filtering to find code by both meaning and exact matches.
ColGrep-Agent-2B extends this search functionality with an iterative search-and-read loop.
Rather than relying on a single search query, the agent follows leads, inspects candidate files, refines its searches, and identifies relevant code locations over multiple turns.
🧠 Training and harness
ColGREP-Agent-2B
is built on MiniCPM5-2B and trained in two stages: a short supervised fine-tuning (SFT) cold start followed by reinforcement learning (RL) using GRPO.
We construct multilingual code-localization environments from
nebius/SWE-rebench
,
internlm/SWE-Fixer-Train-110K
, and additional scraped repositories covering multiple programming languages. Each training instance pairs a repository with an issue description and a dedicated bug-fix commit. We use the pre-patch repository state as the search environment and derive gold file- and line-level localization targets from the corresponding patch. These data sources are used across both the SFT and RL stages.
We first perform a short cold-start SFT phase using traces generated and filtered with
Qwen3.5-27B as a teacher model
. This stage teaches tool-call formatting, command ordering, argument and flag usage, and effective repository exploration strategies, with an emphasis on semantic search through ColGrep rather than traditional grep-based search. We then train for
500 steps using GRPO
in a dedicated code-localization environment, rewarding accurate file- and line-level identification while penalizing unnecessary exploration steps.
The model operates in a repository exploration environment with access to three tools:
Tool
Purpose
colgrep
Search code semantically, with optional regex and path filters.
terminal
Read files and inspect the repository through read-only commands.
finish
Submit relevant locations as
path/to/file:START-END
.
The agent has a
10-turn budget
to search and inspect the repository before submitting its final prediction as a set of relevant file paths and line ranges.
📊 Evaluation
We evaluate ColGREP-Agent-2B on
SWE-bench Lite
and
Multi-SWE-bench Flash
, adapting both benchmarks into code-localization tasks following the methodology described in our
paper
. Rather than generating patches or resolving issues end-to-end, the model is tasked with identifying the files and lines of code relevant to each issue. This allows us to evaluate localization accuracy independently of code generation.
Model
Harness
SWE-bench Lite
Multi-SWE-bench Flash
File F1
Line F1
File F1
Line F1
lightonai/colgrep-agent-2B
ColGrep
76.18
19.92
62.57
15.93
openbmb/MiniCPM5-2B
ColGrep
66.72
9.62
52.01
11.31
google/gemma-4-31B-it
ColGrep
79.93
17.08
68.30
19.14
Qwen/Qwen3.5-27B
ColGrep
77.93
15.71
68.28
16.63
google/gemma-4-26B-A4B-it
ColGrep
76.35
13.34
63.50
14.75
Qwen/Qwen3.8-27B
ColGrep
60.80
7.70
59.68
11.50
deepseek-ai/DeepSeek-V4-Flash
ColGrep
74.04
11.36
64.26
13.64
All models use the ColGREP harness. File and line F1 measure overlap with reference files and lines, respectively. Scores are percentages averaged over five seeds (300 instances per benchmark per seed), using strict predictions without rescue, a 10-turn limit with mandatory final submission, and temperature 0.6 without reasoning for comparison models.
📚 Citation
@misc{colgrepagent_2026,
title = {ColGrep-Agent},
author = {Lasbordes, Maxence and Sourty, Raphael and Sinha, Aarush and Chatelain, Amélie},
year = {2026},
howpublished = {\url{https://huggingface.co/blog/lightonai/colgrep-agent/}}
}
Runs of lightonai colgrep-agent-2B on huggingface.co
64
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About colgrep-agent-2B huggingface.co Model
colgrep-agent-2B huggingface.co is an AI model on huggingface.co that provides colgrep-agent-2B's model effect (), which can be used instantly with this lightonai colgrep-agent-2B model. huggingface.co supports a free trial of the colgrep-agent-2B model, and also provides paid use of the colgrep-agent-2B. Support call colgrep-agent-2B model through api, including Node.js, Python, http.
colgrep-agent-2B huggingface.co is an online trial and call api platform, which integrates colgrep-agent-2B's modeling effects, including api services, and provides a free online trial of colgrep-agent-2B, you can try colgrep-agent-2B online for free by clicking the link below.
lightonai colgrep-agent-2B online free url in huggingface.co:
colgrep-agent-2B is an open source model from GitHub that offers a free installation service, and any user can find colgrep-agent-2B on GitHub to install. At the same time, huggingface.co provides the effect of colgrep-agent-2B install, users can directly use colgrep-agent-2B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.