MIMIR

io.github.abderahmane-ai由 GitHub 帳號 abderahmane-ai 發布v1.2.0更新於 Oct 25, 2026

Typed, calibrated and certified decisions over a context, with abstention and evidence.

概覽

AI 產生的概覽

MIMIR 是本地執行的非生成式決策伺服器,讓助理對情境做型別化、校準且可稽核的選擇、驗證、排序與評分。

可以做什麼
依你提供的選項與情境做出型別化決策,回傳答案、校準機率與證據,並標示已決定、棄權或轉交。
適用情境
當代理需要可稽核、可重複的分類、路由、驗證或排序決策,而不是自由生成文字時適用;也適合在工具呼叫前依政策規則放行、拒絕或轉交人工審核。需要校準機率與風險上限的客服分流、合規檢查或高吞吐自動化流程特別合適。
執行需求
以 uvx 執行 PyPI 套件 mimir-decisions(需 Python 3.11 以上),或使用容器映像;首次載入會從 Hugging Face 下載並驗證模型權重,需要網路。MCP 工具需以 tools.yaml 設定;HTTP 模式可選用 MIMIR_API_KEYS 環境變數。
安裝前請注意
首次執行會下載模型權重並驗證簽章,需要網路與磁碟空間。工具會依你撰寫的規則決定是否允許代理的工具呼叫,設定錯誤可能誤放行或誤攔截。情境內容會送入模型;若改用遠端伺服器,資料會傳到該端點。模型權重另有授權條款,商業使用與營收門檻須自行確認。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

mimir-decisions

Decisions your agents can act on. MIMIR is a non-generative decision model: give it a context, a question and the options, and get back a typed answer with calibrated probabilities, the evidence behind it, and a certified verdict on whether to act or escalate. No text generated. Nothing to parse. Nothing to hallucinate.

It beats Laya and GLiNER2.5-Decide head-to-head on six of ten tasks — by 54.7 points on Banking77, 42.3 on MASSIVE, 36.3 on typed decisions — and where it cannot back an answer, it abstains instead of guessing.

bash
pip install "mimir-decisions[local]"        # the local engine (CPU and CUDA)pip install mimir-decisions                  # data models and HTTP client only

Python 3.11+. Documentation: https://abderahmane-ai.github.io/mimir/


Why MIMIR

Most agents route, classify, and verify using a general-purpose language model: slow, expensive, and impossible to audit. MIMIR is built for structured decisions. It runs locally on Torch, on CPU or GPU, returns calibrated probabilities with every answer, and issues a certificate — measured evidence that answers passing its threshold stayed at or below the risk level you ask for, on held-out data.

  • No generation. Answers are drawn from the options you supply, not synthesised. The model cannot hallucinate an answer that wasn't on the list.
  • Calibrated confidence. Probabilities are not softmax scores; they are calibrated to match realised accuracy on held-out data.
  • Answers, always. Every decision returns the model's prediction with its probabilities. In threshold and certified modes, answers below the floor come back deferred for review — never withheld.
  • One typed contract. Seven decision types — choice, multi-choice, yes/no, verify, rank, rate, estimate — all returning the same result shape, over any context.
  • Portable. The same Python interface works locally on CPU or GPU, over HTTP, and over MCP. Framework adapters exist for eight agent SDKs.

Quickstart

python
from mimir import Context, Field, Mimir, Passage
model = Mimir.from_pretrained("Mythologic/MIMIR-1")
# The short form: the chosen option id, or None when the model abstains or defersteam = model.pick(    "Hi, invoice INV-8821 was billed twice. Please refund the duplicate.",    ["billing", "technical", "sales"],)  # "billing"
# Context pairs prose passages with typed structured fields (amounts, IDs, metadata)context = Context(    passages=[        Passage(            title="Ticket #4091",            text="Hi, we were billed twice ($2,400 total) on invoice INV-8821. Please refund the $1,200 duplicate today or we will cancel our plan.",        )    ],    fields=Field.from_json({        "invoice_id": "INV-8821",        "duplicate_amount": 1200,        "customer_plan": "enterprise",    }),)
# The question is optional: model.choose(context, options) asks "Which option applies to this context?"result = model.choose(    context,    "Which department should handle this request?",    options={        "billing": "Billing: invoices, payments, refunds",        "technical": "Technical: bugs, outages, system errors",        "sales": "Sales: pricing, new contracts",        "other": "Other: everything else",    },)
result.status         # Status.DECIDED, Status.ABSTAINED or Status.DEFERREDresult.answer         # "billing", or None when no option appliesresult.probabilities  # calibrated probability of each option idresult.certificate    # mathematical proof of risk bound on held-out data

answer is always the model's prediction. status says whether it cleared the operating floor:

  • DECIDED — act on answer.
  • ABSTAINED — no listed option applies (clean OOD rejection).
  • DEFERRED — the answer came in below the certificate floor; route to a human reviewer.

The Risk Dial: From Mission-Critical SLA to High-Throughput Agents

The release certifies thresholds across four finite-sample risk levels (model.info().risk_levels = (0.005, 0.01, 0.02, 0.05)):

  • risk=0.01 (99.0% SLA) — Mission-critical aerospace / financial SLA: Sets an ultra-strict statistical floor. Only near-certain answers execute automatically; anything uncertain is deferred for human review rather than risked.
  • risk=0.05 (95.0% SLA, the default) — High-throughput web agent / customer workflow: The sweet spot for autonomous agents, unlocking automated execution on legitimate requests while still mathematically bounding error rates on held-out data.
  • mode="standard" — Returns the calibrated argmax without finite-sample risk deferral; risk then only selects the certificate attached to the result. mode="certified" also defers below the threshold certified at risk.

Give the model the ticket as a person wrote it paired with typed fields — the same options over a one-line summary can come back ABSTAINED. The Decisions guide covers the question and option shapes that decide.

The first call downloads the model from the Hugging Face Hub at the revision this package version pins, verifies its Sigstore signature, checks every file against the manifest's SHA-256, and loads it.


Decision types

SpecAnswer
Choice(question, options)an option id, or None
MultiChoice(question, options)the option ids that apply
YesNo(question)True or False
Verify(claim)supported, contradicted, or not_enough_information
Rank(question, candidates)candidate ids, best first
Rate(question, levels)a level id; levels given lowest first
Estimate(question, low, high, unit)a number in [low, high], with a confidence interval
python
from mimir import Context, Field, Passage, Rate, Table
context = Context(    passages=[Passage(title="Ticket #4412", text="The export has failed every night this week.")],    tables=[Table.from_rows([["2026-03-02", "failed"]], header=["date", "status"])],    fields=Field.from_json({"customer": {"plan": "enterprise", "seats": 240}}),)result = model.decide(context, Rate("How urgent is this?", ["low", "medium", "high"]), risk=0.01)

A context can be a string, a list of strings, a dict read as a JSON state, or a Context of typed passages, tables, and fields. Table.from_dataframe(frame) reads a pandas or polars DataFrame. decide_many batches multiple decisions, and every method has an async counterpart (adecide, adecide_many, …).


Certification

decide answers every request in standard mode. threshold mode defers answers below your min_confidence; certified mode defers answers below the release's threshold at risk (model.info().risk_levels), and attaches the certificate when the answer passes. Dial risk=0.01 (99% SLA) for mission-critical operations where false actions carry heavy penalties, or risk=0.05 (95% SLA) for high-throughput autonomous agents. decide_uncertified returns the raw model answer with no policy applied.

A certificate covers one exact configuration: weights, Torch version, device, and hardware. On hardware not listed in the certificate, the first load runs the release's equivalence set and requires every decision to match. To certify thresholds on your own labelled data:

bash
mimir calibrate labelled.jsonl --risk 0.01 --confidence 0.95 --out policy.json
python
model = Mimir.from_pretrained("Mythologic/MIMIR-1", policy="policy.json")

Remote use

python
from mimir import MimirClient
remote = MimirClient("https://mimir.internal", api_key="...")remote.choose(    "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan.",    "Which department should handle this request?",    options={        "billing": "Billing: invoices, payments, refunds",        "technical": "Technical: bugs, outages, system errors",        "sales": "Sales: pricing, new contracts",        "other": "Other: everything else",    },)

MimirClient has the same interface as Mimir, so all code, decision tools, and framework adapters accept either. It requires only the base install. Connection errors, timeouts, and 429/502/503/504/529 responses are retried with exponential backoff that honours Retry-After.


Decision tools

python
from mimir import Choice
route_ticket = model.tool(    "route_ticket",    Choice(        "Which department should handle this request?",        {            "billing": "Billing: invoices, payments, refunds",            "technical": "Technical: bugs, outages, system errors",            "sales": "Sales: pricing, new contracts",            "other": "Other: everything else",        },    ),    description="Route a support ticket to the team that owns it.",)route_ticket(    "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan.")route_ticket.input_schema, route_ticket.output_schema

Tools can also be declared in a YAML file, which the HTTP and MCP servers load:

yaml
tools:  - name: route_ticket    description: Route a support ticket to the team that owns it.    decision:      type: choice      question: Which department should handle this request?      options:        billing: "Billing: invoices, payments, refunds"        technical: "Technical: bugs, outages, system errors"        sales: "Sales: pricing, new contracts"        other: "Other: everything else"

Tool-call checks

A tool-call check decides, against rules you write, whether an agent's pending tool call may run. A confident yes allows it, a confident no denies it, and anything else escalates to a person.

python
check = model.tool_call_check(    ["Refunds above 500 dollars need a manager's approval."], tools=["issue_refund"])outcome = check("issue_refund", {"order": "4412", "amount": 900})outcome.permission    # Permission.ALLOW, Permission.DENY or Permission.ESCALATEoutcome.reason        # one sentence for the agent or the approver

Benchmarks

benchmarks/mimir_vs_laya_enterprise_benchmark.ipynb (run it in Colab) runs ten scenarios, each a written policy plus a pending tool call: five legitimate and five that violate the policy. Every system sees the same prompts, tools, arguments and policy text. Recorded run: Colab CPU, mimir-decisions 1.2.0, laya 0.4.0.

SystemCorrectPolicy-violating call executed (of 5)Legitimate call executed (of 5)Median latency
Laya, router only4/10541,988 ms
Laya, router + noul gate6/10124,556 ms
MIMIR-1, pick + tool_call_check9/100410,076 ms

The suite is ten scenarios written by the MIMIR authors, so the figures describe this suite rather than a general rate. MIMIR-1's four escalations came at the pick step; its policy check allowed or denied, and denied the two violating calls the router did route to their requested tool (4B and 5B). MIMIR-1 ran in threshold mode at 0.50. Latency is a Colab CPU runtime with two model passes per decision.

benchmarks/sysone-bench records the run on the independent sysone-bench suite.


Agent frameworks

Each adapter turns decision tools into the framework's native tool type and wires a tool-call check into that framework's own approval hook.

FrameworkInstallToolsTool-call check
OpenAI Agents SDKmimir-decisions[openai-agents]as_function_toolguard: escalations pause the run for approval
LangChain / LangGraphmimir-decisions[langchain]as_structured_toolToolCallCheckMiddleware: escalations interrupt with the human-in-the-loop request
PydanticAImimir-decisions[pydantic-ai]as_toolsetguard: escalations end the run with DeferredToolRequests
CrewAImimir-decisions[crewai]as_crewai_tooltool_call_hook: escalations go to your approver
Google ADKmimir-decisions[adk]as_adk_tooltool_call_callback: escalations ask for ADK confirmation
Microsoft Agent Frameworkmimir-decisions[agent-framework]as_function_toolToolCallCheckMiddleware: only confident calls run
LlamaIndexmimir-decisions[llamaindex]as_llamaindex_toolnone
smolagentsmimir-decisions[smolagents]as_smolagents_toolnone
python
from agents import Agentfrom mimir.integrations.openai_agents import as_function_tool
agent = Agent(name="support", tools=[as_function_tool(route_ticket)])

Every framework also reaches MIMIR through its own MCP client. examples/ has a native, an MCP, and a checked agent for each framework, plus a Vercel AI SDK agent in TypeScript.


HTTP server

bash
pip install "mimir-decisions[local,server]"MIMIR_API_KEYS=key-one,key-two mimir serve --host 0.0.0.0 --tools tools.yaml
RouteDoes
POST /v1/decideone decision: {context, decision, mode, min_confidence, risk, alpha}
POST /v1/decide/uncertifiedthe model's raw answer: {context, decision}
POST /v1/decide/batchup to 64 decisions in one call
POST /v1/tools/{name}a tool from --tools, given only {context}
POST /v1/systemoneJev's request and response format
GET /v1/modelsmodel, revision, runtime and certified risk levels
GET /healthz, GET /readyzliveness, and readiness once the model is loaded
GET /metricsPrometheus metrics

Concurrent requests are batched. With keys in MIMIR_API_KEYS, every route except the probes requires Authorization: Bearer <key>. A server with no keys listens only on loopback unless started with --allow-no-auth. The OpenAPI 3.1 document is openapi.json.


MCP server

Each configured tool becomes an MCP tool that takes only a context; --generic-tools adds mimir_choose, mimir_verify, mimir_rank, and mimir_rate. A deferred decision is a normal result telling the agent to escalate.

bash
uvx --from "mimir-decisions[local,mcp]" mimir-decisions mcp --tools tools.yaml               # stdioMIMIR_API_KEYS=... mimir mcp --http --host 0.0.0.0 --tools tools.yaml       # Streamable HTTP at /mcpmimir mcp --tools tools.yaml --remote https://mimir.internal                  # forward to a servermimir serve --mcp --tools tools.yaml                                          # HTTP API and /mcp together

In Claude Code:

bash
claude mcp add mimir -- uvx --from "mimir-decisions[local,mcp]" mimir-decisions mcp --tools /path/to/tools.yamlclaude mcp add --transport http mimir https://mimir.internal/mcp --header "Authorization: Bearer ..."

Claude Desktop, Cursor, and VS Code take the same command or the same URL and header in their MCP configuration. The server is registered in the MCP Registry as io.github.abderahmane-ai/mimir.


Containers

bash
docker run -p 8000:8000 -e MIMIR_API_KEYS=... -v mimir-models:/models ghcr.io/abderahmane-ai/mimir:1.2.0-cpudocker run --gpus all -p 8000:8000 -e MIMIR_API_KEYS=... -v mimir-models:/models ghcr.io/abderahmane-ai/mimir:1.2.0-cuda

Images carry the runtime, never the model weights. On first start, the model is downloaded at the revision the package version pins, verified, and cached in /models. To run from that cache with no network access, append serve --host 0.0.0.0 --model-cache /models --offline.

Images are signed with Sigstore by the release workflow:

bash
cosign verify ghcr.io/abderahmane-ai/mimir:1.2.0-cpu \  --certificate-identity https://github.com/abderahmane-ai/mimir/.github/workflows/release.yml@refs/heads/main \  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Command line

CommandDescription
mimir servethe HTTP server; --mcp also serves MCP at /mcp
mimir mcpthe MCP server, over stdio or --http
mimir decideone decision from flags, or a JSON request on stdin
mimir bench FILEaccuracy, coverage, certified share and realised risk on labelled decisions
mimir calibrate FILEcertify thresholds on labelled decisions
mimir schemaJSON Schemas of every spec, result and request
mimir downloaddownload and verify a release for offline use
mimir doctorreport the environment; --verify loads the model and runs the equivalence check

Integrity

Releases are loaded from a pinned Hugging Face revision. Before any model file is read, the manifest's Sigstore signature is verified against the abderahmane-ai/mimir release workflow and every file is checked against the manifest's SHA-256. No pickle is used anywhere.


Migrating

mimir.compat.systemone.v1 converts Jev /v1/systemone requests and responses, and mimir.compat.laya.v1 exposes load(...).predict(state, questions) in Laya 0.3.20's shape. See the migration guides for step-by-step instructions.


Licensing

The MIMIR SDK is licensed under Apache-2.0; that license covers the software only, not the MIMIR model weights. The MIMIR-1 model weights are licensed separately under the MIMIR Model License.

Eligible community users may use MIMIR-1 commercially without royalties, subject to the MIMIR Model License. Anyone may download, benchmark, evaluate and prototype with MIMIR without registering.

Organizations exceeding the Revenue Threshold (US$1,000,000 annual gross revenue), or requiring enterprise, OEM, redistribution, hosting, or other additional rights, may obtain a commercial agreement from Mythologic. See COMMERCIAL-LICENSING.md.

來源:README.md,提交 2c25d38

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

4
  1. v1.2.0最新Oct 8, 2026
  2. v1.1.0Sep 30, 2026
  3. v1.0.2Sep 29, 2026
  4. v1.0.0Sep 29, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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