gut

io.github.Kungie由 GitHub 账号 Kungie 发布v0.8.2更新于 Oct 24, 2026

Judgment calls on small, cheap models: is this spam, which team, how urgent. YES, NO or UNSURE.

概览

AI 生成的概览

一个本地 MCP 服务器,让助手用小型模型对大量条目做廉价的判断:是/否、分类和评分,并支持明确的“不确定”结果。

可以做什么
对条目回答是/否问题,例如评论是否为垃圾信息、任务是否完成,置信度低时给出“不确定”。把条目归入固定类别之一,例如工单属于哪个团队。按有序量表给条目评分,例如紧急程度。一次对大量条目批量执行同一判断,带缓存和并发。可选择或级联后端,从 TypeSafe 的 Jev 到本地或 OpenAI 兼容模型。
适用场景
适合助手需要对大量文本、文件、提交或搜索结果做分诊或筛选,而规则太脆弱、前沿大模型又太慢或太贵的场景。更适合简短、定义明确的判断问题,而非开放式生成。
运行要求
通过 stdio 在本地运行,通常用 uvx 从 gutfeel-mcp 这个 PyPI 包启动。需通过 GUT_BACKEND 配置后端;远程后端需要 TYPESAFE_API_KEY 或 OPENROUTER_API_KEY,ollaya、ollama 或 openai 后端还需要 GUT_BASE_URL 和 GUT_MODEL。本地后端需要 PyTorch 附加组件。
安装前请注意
会把被判断的文本发送给所配置的后端,可能是 TypeSafe 或 OpenRouter 等第三方服务;使用本地后端可避免。API 密钥通过环境变量传入。判断是概率性的,可能出错,高风险决策应把“不确定”结果转交人工。远程后端按输入计费。

安装

在 SourceWeft 中

  1. 打开 控制台中的 gut,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[gut]

[PyPI] [CI] [Downloads] [Glama MCP server]

Judgment calls as one line of Python — built for Jev, and running on any small model.

Try it in your browser → The site runs gut's local model in the page: no key, no server.

Your code keeps running into questions that aren't logic: Is this comment spam? Which team owns this ticket? How urgent is it? Is the agent's task done? Until now there were three answers:

  • Regex and keyword rules — free and instant, and wrong the moment someone phrases it differently.
  • A frontier LLM — understands anything, at seconds and cents a call, with prose to parse.
  • Train a classifier — cheap to run, once you have the labelled data, the pipeline and the week.

There is a fourth: a small model made for exactly these questions. TypeSafe AI's Jev answers typed questions directly — a probability for yes, a distribution over options, a score on a scale — with nothing to generate or parse, billed on input only. gut is built around it, and makes it a line of code:

python
import gut
gut.configure(backend=gut.JevBackend())   # or just set TYPESAFE_API_KEY
if gut.likely(comment, "is spam"):    hide(comment)

No prompt, no parsing, no threshold — and no model named at the call site.

Three questions

python
gut.likely(ticket, "is a bug report")                      # yes / nogut.classify(ticket, Team)                                 # which one — an Enumgut.rate(ticket, ["can wait", "this week", "right now"])   # how much

It knows when it doesn't know

A regex never hesitates, and neither does an LLM. gut can:

python
match gut.likely(email, "the customer threatens to cancel", ask_human=True):    case gut.YES:    escalate(email)    case gut.NO:     auto_reply(email)    case gut.UNSURE: send_to_a_person(email)

Say how careful to be in words — lean="yes", stakes="high" — and gut works out the thresholds.

A thousand subjects, one line

python
spam = gut.each(comments).likely("is spam")     # one decision per comment, in orderteams = gut.each(tickets).classify(Team)

Jev gets concurrent requests, a local model batched passes, and nothing already cached is asked twice. @gut.semantic does the same for several questions about one subject.

Jev first, any model

Jev is the model gut is designed around. It is not the only one: the model is configuration, and the same line runs unchanged on any of these.

python
gut.configure(backend=gut.JevBackend())                            # TypeSafe AI's Jevgut.configure(backend=gut.JevBackend.openrouter())                 # Jev, through OpenRoutergut.configure(backend=gut.JevBackend.ollaya("winnow:e4b"))         # open decision model, Ollayagut.configure(backend=gut.ZeroShotBackend())                       # NLI model, on your CPUgut.configure(backend=gut.TransformersBackend("Qwen/Qwen3-0.6B"))  # small LLM, on your machinegut.configure(backend=gut.OpenAICompatibleBackend(                 # Ollama, vLLM, llama.cpp    "qwen2.5:1.5b", base_url="http://localhost:11434/v1"))gut.configure(backend=gut.OpenAICompatibleBackend("gpt-4.1-nano")) # OpenAIgut.configure(backend=gut.OpenAIDecisionsBackend())                # OpenAI's Decisions API

Or several at once. Cascade asks the cheapest model first and passes on only what it is unsure of:

python
gut.configure(backend=gut.Cascade(    gut.ZeroShotBackend(),   # free and local: settles the obvious    gut.JevBackend(),        # sees only what the first could not))

Every answer is a model's own probabilities, never parsed from text, and decision.model names the model that gave it. Your own model can be a backend too: here is how.

Install

bash
pip install "gutfeel[jev]"           # + JevBackend: TypeSafe, OpenRouter or Ollayapip install "gutfeel[local]"         # + ZeroShotBackend and TransformersBackend (PyTorch)pip install gutfeel                  # core: any OpenAI-compatible server; FakeBackend for testspip install gutfeel-mcp             # + the MCP server, gutfeel-mcp

The package on PyPI is gutfeel (gut was taken); the import is plain import gut. No model at hand? gut.FakeBackend(answers={"is spam": 0.97}) answers from fixtures, for tests.

From a shell, and for agents

The big model thinks; the small one decides, fast. An agent with gut judges a thousand files, commits or search results in one command instead of reading each one itself:

bash
git ls-files | gut filter "retries failed requests" --read-files --max-cost 0.50claude mcp add gut --env TYPESAFE_API_KEY=your-key -- uvx gutfeel-mcp   # MCP Registry: io.github.Kungie/gutnpx skills add Kungie/gut --skill gut     # teaches a coding agent when to reach for it

Docs

The documentation, one page per idea: Getting started · Backends · Knowing when it doesn't know · Asking everything at once · Async · Exact costs · Caching and observability · Command line · MCP server · Honest limitations. examples/ runs the same code on every backend.

Status and license

Pre-1.0, Apache-2.0. Every code block in these docs runs in the test suite · contributing

来源:README.md,提交 94bdc51

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v0.8.2最新Oct 13, 2026
  2. v0.8.1Oct 7, 2026
  3. v0.8.0Sep 29, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分