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.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 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 附加項。
安裝前請注意
僅為靜態分析:讀取本機檔案並輸出結果,兩個工具不會修改程式碼。會編輯檔案的 --fix 模式屬於命令列工具,不在 MCP 工具中。已退役模型與不支援參數的檢查依賴內建清單,需要定期更新,結果可能落後於服務商變更。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Overllm,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

bash
pip install overllm          # Pythonpip install "overllm[js]"    # adds JavaScript / TypeScript support

Use it

Point it at one file first, so you can see what it flags before you run it on everything:

bash
overllm app.py       # one fileoverllm src/         # a folderoverllm .            # the whole project

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:

app.py:42:5 llm-mechanical  LLM call asks the model to sort    resp = client.chat.completions.create(model="gpt-4o", messages=[...])    -> use sorted()
app.py:88:1 llm-in-loop  LLM call inside a loop: one API round-trip per iteration    completion(model="gpt-4o", messages=[{"role": "user", "content": f"tag {x}"}])    -> batch the inputs into a single call, cache repeated results, or use a function
2 needless LLM calls in 1 file.

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.

RuleSeverityFires whenSuggests
llm-mechanicalerrorThe prompt asks for a mechanical transform: sort, reverse, count, sum, deduplicate, change case, base64, arithmetic on literals.the one-line stdlib equivalent
llm-extractionerrorThe prompt asks the model to extract an email, URL, date, or number.a regex, datetime, or urllib.parse
prompt-injectionerrorUntrusted web-request input (request.args, request.json, ...) flows straight into the prompt.keep it in a separate user message, validate it, constrain the model
llm-in-loopwarningAn LLM call runs once per loop iteration (real N calls, not streaming).batch, cache, or move it out of the loop
deprecated-modelerror / warningThe model id is a retired model (the call 404s) or one that is deprecated and scheduled for removal.switch to the current model it names
unsupported-paramswarningtemperature / top_p / top_k is set on a model that rejects them — the OpenAI reasoning (o1, o3, ...) series and the newest Anthropic models.remove the parameter; steer with the prompt instead
json-mode-missing-jsonerrorresponse_format={"type": "json_object"} is set but the fully-static prompt never contains the word "json" — a guaranteed OpenAI 400.add "json" to a message, or use a json_schema format
static-promptinfoThe user prompt is a compile-time constant, no variables. The input is fixed, so the call buys nothing.precompute or cache the result

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

python
resp = client.chat.completions.create(...)  # overllm: ignoreresp = client.chat.completions.create(...)  # overllm: ignore=llm-in-loop

Put # overllm: ignore-file at the top of a file to skip the whole file.

Configure

In pyproject.toml (Python 3.11+):

toml
[tool.overllm]ignore = ["llm-in-loop"]exclude = ["examples/", "migrations/"]llm_calls = ["myapp.llm.ask", "chat_service.complete"]

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:

bash
overllm . --write-baseline        # writes overllm-baseline.json — commit itoverllm . --baseline              # reports only findings new since the snapshotoverllm . --update-baseline       # ratchet: also drop entries you've since fixed

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:

bash
overllm . --fix                  # drop a sampling param the model rejects (safe)overllm . --fix --unsafe-fixes   # also swap a retired model id for its replacementoverllm . --fix --diff           # print the patch, don't touch anything

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:

yaml
repos:  - repo: https://github.com/theadamdanielsson/overllm    rev: v0.6.0    hooks:      - id: overllm

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.

yaml
name: overllmon:  pull_request:
permissions:  contents: read  pull-requests: write
jobs:  check:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: theadamdanielsson/overllm@v1        with:          paths: "."

Other output formats

bash
overllm --format json .      # machine-readableoverllm --format sarif .     # upload to GitHub code scanningoverllm --format github .    # GitHub Actions inline annotationsoverllm --format markdown .  # the PR-comment body

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:

yaml
name: overllm-scanon: [push, pull_request]permissions:  contents: read  security-events: write   # required to upload resultsjobs:  scan:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - run: pipx run overllm . --format sarif --exit-zero > overllm.sarif      - uses: github/codeql-action/upload-sarif@v3        with:          sarif_file: overllm.sarif          category: overllm

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):

bash
pip install "overllm[mcp]"
json
{  "mcpServers": {    "overllm": {      "command": "uvx",      "args": ["--from", "overllm[mcp]", "overllm-mcp"]    }  }}

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.7.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分