LLM Preflight

io.github.feronovak由 GitHub 帳號 feronovak 發布v2.23.1更新於 Nov 7, 2026

Local, cross-provider preflight checks for LLM integration changes.

發布方自己的服務:Preflight

概覽

AI 產生的概覽

本機 MCP 伺服器,讓編碼助理在更換模型、提示詞或供應商前驗證 LLM 輸出契約、預覽請求計畫並執行有界的預檢。

可以做什麼
  • 稽核程式碼中的字面模型 ID 並驗證預檢設定
  • 在不呼叫供應商的情況下預覽執行計畫、定價與請求上限
  • 依設定的輸出規則執行預檢並讀取結構化判定
  • 比對已儲存的基準並核驗執行紀錄
  • 把關 CI 證據並規劃退役模型的遷移
適用情境
當你維護 LLM 功能,希望助理在切換模型、提示詞、schema 或供應商之前,依應用程式依賴的 JSON 結構、標籤或精確輸出檢查回應,並為變更審查保留可核查的證據時使用。
執行需求
以 stdio 本機程序執行,透過 llm-preflight-mcp 指令並傳入工作區路徑啟動;需要 Python 3.10 以上,無第三方執行階段相依套件。真實供應商檢查需要設定中指定的環境變數(例如 OPENAI_API_KEY)提供 API 金鑰,並需要網路存取。
安裝前請注意
真實執行會產生付費的供應商請求;README 說明直接執行 CLI 沒有另外的核准提示,用戶端的確認欄位也不能證明有人授權花費。請保持工具核准開啟,並先檢視請求上限與費用上限。失敗的回應預設會被儲存,結果預設寫入 results/ 目錄。通過的執行只對已設定的工作負載構成證據,並不代表生產核准。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

LLM Preflight

Last reviewed: 2026-10-29 · As of: v2.23.0

[PyPI] [Tests] [License]

Check LLM responses against the output rules your application depends on—before changing a model, prompt, schema, or provider.

Define the JSON shape, routing labels, or exact output your feature needs. Check responses against those rules, preview provider requests and estimated cost, and keep evidence for the change review.

Built for engineers maintaining an LLM feature. Runs locally as a CLI, GitHub Action, or MCP server. Python 3.10+; no third-party runtime dependencies.

Try it · Observed models · Use your own contract · CI and agents

Watch an invalid response get caught and fixed (23 seconds).

billing passes → change the response to sales → check fails → restore billing → check passes. The allowed labels stay unchanged.

[Real terminal session: billing passes, sales fails the same validator, and restoring billing passes again]

Real CLI output with synthetic response fixtures. This checks the validator; it makes no provider requests and does not execute your application's parser. Watch the MP4.

New in 2.23.0

This release adds GPT-6.1 Terra pricing and native Kimi, MiniMax, Mistral and Cohere text checks, plus GLM Flash and restricted Mythos coverage. See native provider checks for bounded examples and request limits. New coverage has deterministic protocol fixtures; live observations below cover the listed 19 routes. Other added providers retain fixture-only coverage.

Try it in 60 seconds

In a new directory, install the tool and run the local mock—no API key or provider request:

bash
python3 -m venv .venv. .venv/bin/activatepython3 -m pip install llm-preflightllm-preflight initllm-preflight benchmark.json --no-save --no-env-file

The activation command above is for POSIX shells; PowerShell uses .\.venv\Scripts\Activate.ps1.

init refuses to overwrite an existing config. Look for local-mock with PASS in the quality gate: the mock replied ok and passed the exact-output test. The overall decision is inconclusive (exit 3) because a local mock provides no live-provider evidence. The demo worked; it cannot approve a model. --no-save skips JSON/Markdown result artifacts; --no-env-file skips credential files.

Watch the interactive default template (30 seconds)

Select the mock and default Reply with ok test, review the plan, and confirm the local run. The session also reads the same decision through CLI JSON:

[Interactive default-template demo: select the mock and configured test, review the plan, run locally, and inspect the expected inconclusive result as JSON]

Local test: passed. Live provider: not tested. No API keys or provider calls. Watch the MP4 or start with the text walkthrough and interactive CLI JSON example.

For benchmark runs, read the decision before acting:

  • pass, exit 0: the configured checks passed with the required evidence.
  • fail, exit 1: a configured check failed; inspect the cause.
  • inconclusive, exit 3: evidence is insufficient; read the blocking warnings.

A passing run is evidence for the configured workload, not production approval.

Observed results on a support-routing contract

The latest measurement, 2026-10-29, tested 19 native model routes on eight synthetic support-routing and strict JSON cases each. 144 of 152 checks passed: three outputs failed their contract and five Kimi calls returned HTTP 429. 15 models passed all eight checks. These are workload observations, not a ranking of general intelligence or production approval.

[All 19 measured models: valid responses versus API errors, mean latency, estimated token cost for this run and native route; small-sample limits and partial costs are explicit]

Latency includes successful API responses, including contract failures, and excludes API errors. The known token-cost subtotal is $0.06902127; total cost is unknown because five error responses supplied no usage. Each request used a 1,024-token output allowance and one attempt. No retries were made. Read all 19 rows, the method and failure analysis. Previous dated measurements remain available as history.

First live run

Start with one rule your application already enforces. The project integration guide provides a complete routing contract with accepted/rejected fixtures and a no-spend pull-request check. Match your deployed prompt and response parser; local fixture checks do not execute application code automatically.

To try a minimal provider starter instead:

bash
llm-preflight init live.json --template provider \  --provider openai --model gpt-6.1-sol --api-key-env OPENAI_API_KEY

The starter asks for exactly ok. Add this top-level field to live.json, keeping its existing fields, to check the validator locally:

json
{  "validation_fixtures": [    {"name": "accepted-label", "response": "ok", "expect": "pass"},    {"name": "rejected-label", "response": "not ok", "expect": "fail"}  ]}

Set OPENAI_API_KEY in your shell or in an uncommitted .env.production beside live.json. The config stores the variable name, never the key. Preview the check without making a generation request:

bash
llm-preflight live.json --contract-checkllm-preflight live.json --doctorllm-preflight live.json --pricing-checkllm-preflight live.json --dry-run

The starter has a three-request limit and a $0.05 estimated-cost cap. Resolve warnings and review the route, retry-expanded request bound, pricing and retention settings. The starter saves failed responses by default; review artifacts before sharing them.

Paid request: only after reviewing and authorizing that plan, run:

bash
llm-preflight live.json

A direct CLI run has no separate approval prompt. Results are saved as JSON and Markdown under results/ unless you use --no-save. The CLI reads the config-adjacent .env.production without replacing existing shell values; choose another file with --env-file PATH or skip it with --no-env-file.

Choose your path

See a contract change fail

A review artifact retains the decision, contract validity, latency, usage, estimated cost and blocking warnings. Render saved schema-version-1 JSON as a standalone report without another provider request. Substitute the saved JSON path printed by your run for results/run.json:

bash
llm-preflight report results/run.json --output report.html

The renderer omits prompts, responses, local paths and identifying run metadata. For reproducible examples, run these from a source checkout:

bash
python3 -m llm_preflight report examples/reports/schema-baseline.json --format markdownpython3 -m llm_preflight report examples/reports/schema-break.json --format markdown

The first synthetic result passes; the second reports contract_failure, 67% contract validity and one contract-only failure. The report gallery also demonstrates a gate blocked with no_record (exit 1). These fixtures make no provider calls and cannot supply attested CI evidence.

CLI, CI, and MCP

Works as a CLI, GitHub Action, and local MCP server. The Action defaults to no generation requests; a live MCP run requires explicit paid-run confirmation. Keep the client's tool approval enabled: its confirmation field is not proof that a person authorized spending.

No preflight, no merge. With a required check configured, the offline gate requires a fresh passing CI record matching the current contract, routes, prompts and run selection. Protect the producer and gate workflows; signed records also need gh attestation verify before the gate. Follow proof of preflight to configure it. A local fixture pass or installed package does not enforce a merge policy.

It doesn't certify production behaviour. It proves the check was done.

MCP for coding agents

Configure the installed stdio command in your MCP client:

json
{  "mcpServers": {    "llm-preflight": {      "command": "llm-preflight-mcp",      "args": ["--workspace", "/absolute/path/to/repository"]    }  }}

The eight tools (migrate_plan is main branch only, not in 2.23.1) audit literal model IDs, validate a config, preview a plan, run a preflight, compare saved baselines, verify a record, gate CI evidence and plan a retired-model migration. For an existing contract, begin with validate_config and dry_run_plan. Agents must read the structured decision and report missing evidence. See the MCP guide for request/result examples and workspace boundaries.

The agent-smoke suite with --smoke makes six requests per model before configured retries. Use the coding-agent workflow for CLI commands. An agent must not weaken a validator to get a pass or infer permission for paid work from a gate result.

Common jobs

  • Audit existing model IDs: llm-preflight --audit-source . reports literal IDs marked retired or retiring in the bundled snapshot. No config or key is needed. Add --ci to make the retirement decision affect the exit code; without it, findings normally exit 0. In Git, the scan reads tracked, unignored files. See model retirements.

  • Replace a retired model: llm-preflight migrate benchmark.json --output migrate.json writes a candidate of the provider-named replacements and prints its plan. After you record an approval receipt, migrate ... --run --verify-approval-receipt R runs one bounded smoke. See model retirements.

  • Inspect pricing: --doctor provides pricing advisory; --pricing-check is the fail-closed coverage gate. Preview the run with llm-preflight benchmark.json --dry-run.

  • Review Git changes: llm-preflight benchmark.json --change-plan proposes checks from static signals; it does not authorize execution.

  • Discover a candidate: refresh metadata, prepare a plan and preview it:

    bash
    llm-preflight catalog refresh benchmarks/watch.jsonllm-preflight catalog prepare benchmarks/watch.json \  --against benchmarks/approved.json --output benchmarks/candidates.jsonllm-preflight benchmarks/candidates.json --migration-check --dry-run

    Create the watch/approved files first with the model catalogue guide. Catalogue probes are a separate, potentially billable step.

Change a model safely

Put approved and candidate models in a reviewed config, then preview the built-in compatibility pack:

bash
llm-preflight benchmark.json --migration-check --dry-run

After approving that plan, llm-preflight benchmark.json --migration-check sends three built-in cases per model before configured retries: a capital-city answer, summary and rewrite. They check basic compatibility; use your own application contract tests to establish whether the change meets your feature's rules.

Safety boundary

Results apply to the configured account, route, prompts and validators at one time. Model responses remain stochastic. Deterministic validation checks the rules you declare; it does not establish semantic accuracy or production safety. Preview limits before live requests and keep paid-run authority with the person responsible for the integration.

How it compares

Use this project for a bounded contract check and reviewable evidence before an integration change. Evaluation frameworks also support assertions and CI; keep one when it already meets your needs. Broader evaluation suites serve semantic scoring and statistical comparisons; observability tools serve production tracing and incident investigation. See when to use it.

Get help or try it in your project

Ask for setup help or a contract example. Include the version, intended check and redacted output. Never share keys, private prompts or provider responses. Use the security policy for vulnerabilities.

Documentation

The documentation homepage routes by task. Consult CLI reference, configuration and result JSON for exact behavior. Native routes and dated pricing coverage are listed in current snapshots. The AI implementation testing guide explains the intended workflow and scope.

Release notes for every version are in the changelog.

Contributing and license

See Contributing for development and documentation standards. Released under the MIT License.

來源:README.md,提交 7336c0d

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

11
  1. v2.23.1最新Nov 7, 2026
  2. v2.23.0Oct 29, 2026
  3. v2.22.2Oct 19, 2026
  4. v2.22.1Oct 18, 2026
  5. v2.21.2Oct 14, 2026
  6. v2.20.1Oct 12, 2026
  7. v2.19.1Oct 8, 2026
  8. v2.19.0Sep 30, 2026
  9. v2.18.2Sep 29, 2026
  10. v2.17.1Sep 25, 2026
  11. v2.13.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Preflight 整合