
Overllm
io.github.theadamdanielsson由 GitHub 账号 theadamdanielsson 发布v0.7.0更新于 Oct 24, 2026
Find the LLM/AI calls you didn't need — where plain code or a regex does the job. No model.
概览
本地 MCP 服务器,运行 overllm 静态检查器,让助手审查 Python、JavaScript 和 TypeScript 代码中不必要的 AI 模型调用。
- 可以做什么
- 扫描磁盘上的文件或目录,返回规则、位置和建议替换方式(scan_path)。以同样方式扫描内联代码片段(scan_code)。报告的问题包括:库函数即可完成的机械转换、正则即可完成的提取、循环内的模型调用、已退役的模型 ID、模型不支持的采样参数,以及请求输入直接进入提示词的注入风险。两个工具都不会写入或修改任何内容。
- 适用场景
- 适合在审查调用 OpenAI、Anthropic、Google、LangChain、LiteLLM、Ollama 等 SDK 的代码库或代码片段时使用,找出本可用普通库函数完成的地方。也适合作为提交前或 CI 门禁的确定性检查。
- 运行要求
- 作为本地进程运行;需安装带 mcp 附加项的 overllm 包(服务器需要 Python 3.10+)。不需要 API 密钥、网络访问或模型;可选的 JavaScript/TypeScript 解析需安装 js 附加项。
安装
在 SourceWeft 中
- 打开 控制台中的 Overllm,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
overllm
Catch the LLM/AI calls you didn't need.
overllm is a small, fast linter with one job: find the places in your code where you call an AI model to do something plain code does better. You called GPT to parse a date. You called a model to extract JSON that json.loads already handles. You are paying latency, money, and nondeterminism for a regex.
It reads your code with a real parser: Python through the standard-library ast, and JavaScript and TypeScript through tree-sitter. No model runs, no network, no API key. Same code in, same result out. Fast enough for a pre-commit hook.
Cost dashboards and caches deal with calls you've already decided to make. overllm asks the earlier question — did you need the call at all — and answers it from the source, before you run anything. Everyone else lints the code the AI wrote; overllm catches where you're paying an AI to do what a library already does.
Install
Use it
Point it at one file first, so you can see what it flags before you run it on everything:
It reads your code and prints what it finds. By default it writes nothing and changes nothing — the worst case of a plain run is a few lines of output. The one mode that edits files is the opt-in --fix (below), and only for the two mechanically-safe fixes.
Example output:
It is quiet by default. Only warning and error findings show, so a clean project prints nothing and exits 0 — most codebases surface a handful or none. If it floods you, treat that as a bug and open an issue.
overllm exits non-zero when it finds something, so it gates a commit or a CI check. Pass --exit-zero to report without failing.
Your code stays on your machine
overllm is static analysis. It parses your files locally, then prints what it found. It never uploads your code, never calls an API, needs no key, and sends no telemetry — there is no model in the loop and nothing phones home. Pull your network cable and it runs exactly the same.
The core is a couple thousand lines of Python with no required dependencies, so you can read all of it before you trust it. overllm[js] adds tree-sitter to parse JavaScript and TypeScript; that is the only optional dependency.
Rules
Every rule fires only on a concrete code pattern, and every finding names the deterministic replacement. It stays silent when it is not sure.
By default overllm only raises warning and above, so it is quiet on your everyday code. static-prompt is info and stays silent unless you ask for it with --all or --min-severity info.
The last two check the call itself, not the prompt: a model id that no longer exists, or a knob the model ignores. Both are matched exactly against a known list, so a live model or alias is never flagged. The lists track provider deprecation pages and need updating over time.
It detects the OpenAI, Anthropic, Google, Mistral, Cohere, Groq, AWS Bedrock, HuggingFace, Replicate, LangChain, LiteLLM, and Ollama SDKs in Python, the Vercel AI SDK (generateText, streamText, generateObject) and the openai / anthropic node SDKs in JavaScript and TypeScript, and raw HTTP requests to those hosts. It also follows a model through LCEL composition — a chain = prompt | model | parser pipe, a bound model (.with_structured_output(...)), or an alias — so chain.invoke(...) is seen; embeddings calls (embeddings.create) count too. When a call goes through your own wrapper or a framework overllm can't see, name it in llm_calls (below).
Silence a false positive
Put # overllm: ignore-file at the top of a file to skip the whole file.
Configure
In pyproject.toml (Python 3.11+):
Or on the command line: --select, --ignore, --min-severity, --all, and --config PATH (exclude is config-only). Run overllm --help for the full list.
Teaching overllm your own wrapper
Most code doesn't call the SDK inline — it wraps it (def ask(prompt): client.chat.completions.create(...)). overllm follows that wrapper on its own when it lives in the same file. When the call goes through a framework, a provider layer, or a **kwargs splat, overllm can't see the SDK call, so tell it the wrapper's name in llm_calls. After that, calls to ask(...) are treated like LLM calls — it reads the prompt argument and runs the loop and cost rules. A name matches bare (ask), dotted (myapp.llm.ask), or that dotted path imported under its short name.
Adopt on an existing codebase (baseline)
Dropping overllm on an old repo gives you a wall of findings you'll never get through. Snapshot them once and have CI flag only what's new after that:
The snapshot keys each finding on rule + file + code + model, not the line number, so unrelated edits above it don't invalidate it. And it counts how many times each one shows up instead of just diffing totals, so a new bad call still trips the check even if you happened to delete an old one somewhere else.
Fix what's safe (--fix)
Two of the rules have one obvious fix, so overllm can just do it for you:
Plain --fix only does the safe one (unsupported-params). Swapping a model id
changes what your code actually does at runtime, so that's behind
--unsafe-fixes. Fixes edit the syntax tree, not the raw text, so your comments
and strings are left alone, and overllm re-parses the file before saving — if the
edit would break it, it's dropped. The other five rules need a human call, so it
never touches them.
Pre-commit hook
In .pre-commit-config.yaml:
GitHub Action
overllm ships an Action that scans a pull request and leaves one grounded comment. It stays silent when there is nothing to say.
Other output formats
GitHub code scanning (SARIF)
overllm can output SARIF, so findings show up in the Security tab and inline on the diff. It's free on public repos:
Use it from an agent (MCP server)
overllm ships an MCP server, so an AI agent (Claude Desktop, Cursor, or anything that speaks MCP) can call it to audit code for needless model calls. It exposes two tools: scan_path (a file or directory on disk) and scan_code (a snippet passed inline). Both return the same findings the CLI does — the rule, the location, and the concrete replacement — and neither writes or changes anything.
Install the server variant and point your client at it (the server needs Python 3.10+; the linter itself still runs on 3.9):
Then ask the agent things like "scan this repo for unnecessary LLM calls" or "is this function wasting a model call?" and it gets grounded, deterministic findings instead of guessing.
Why not just use an AI code reviewer?
AI reviewers and AI-slop linters look at the code the model produced: comments, dead code, structure. None of them ask the question overllm asks, which is whether you needed the model at all. It is a different axis, and it is one plain static analysis can answer with high precision and zero cost.
Contributing
The most useful thing you can send is a false positive: a real line of code where overllm flags a call it should not. A linter is only worth running if it is right, so one concrete bad flag is worth more than a feature request. CONTRIBUTING.md covers how to report one and how to run the tests.
Past releases and what changed are in CHANGELOG.md.
License
MIT © Adam Danielsson
来源:README.md,提交 c04154f
工具
0版本历史
1- v0.7.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分