Omni Nli

io.github.CogitatorTech由 GitHub 帳號 CogitatorTech 發布v0.1.1更新於 Oct 24, 2026

An MCP server for natural language inference

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

概覽

AI 產生的概覽

一個可自架的自然語言推論伺服器,讓助理判斷假設是被前提蘊含、與前提矛盾,還是與前提無關。

可以做什麼
評估前提與假設文字對,回傳蘊含、矛盾或中立三種標籤之一,並附上信心分數與選用的推理過程。作為驗證層,檢查生成內容是否有事實依據或是否與先前的陳述一致。核對摘要是否與原文矛盾,並檢驗檢索到的文件是否蘊含查詢。可作為供代理使用的本機 MCP 伺服器,也可作為獨立的 REST 微服務執行。
適用情境
當你希望助理對生成內容、摘要或搜尋結果與原文做事實查核或一致性檢查,且願意自行執行與設定推論後端時適用。
執行需求
以 Python 套件透過 pip 安裝並在本機執行,使用 omni-nli 指令啟動。需要模型後端,例如 Ollama、HuggingFace(含受限模型)或 OpenRouter,這些後端可能需要各自的帳號或存取權杖。清單中未宣告環境變數或請求標頭。
安裝前請注意
README 說明專案處於早期開發階段,可能出現錯誤與不相容變更。結果品質高度取決於所選模型,建議以領域資料微調。使用 HuggingFace 或 OpenRouter 等託管後端時,文字可能傳送給第三方,且可能需要憑證。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

[Omni-NLI Logo]

Omni-NLI

[Tests] [Code Coverage] [Python Version] [PyPI] [Documentation] [License]
[Examples] [Docker Image (CPU)] [Docker Image (CUDA)]

A multi-interface (REST and MCP) server for natural language inference


Omni-NLI is a self-hostable server that provides natural language inference (NLI) capabilities via RESTful and the Model Context Protocol (MCP) interfaces. It can be used both as a very scalable standalone stateless microservice (via the REST API) and also as an MCP server for AI agents to implement a verification layer for AI-based applications.

[Architecture Diagram]

What is NLI?

Given two pieces of text called premise and hypothesis, NLI (AKA textual entailment) is the task of determining the directional relationship between them as it is perceived by a human reader. The relationship is given one of these three labels:

  • "entailment": the hypothesis is supported by the premise
  • "contradiction": the hypothesis is contradicted by the premise
  • "neutral": the hypothesis is neither supported nor contradicted by the premise

[!IMPORTANT] NLI is not the same as logical entailment. Its goal is to determine if a reasonable human would consider the hypothesis to follow from the premise. This checks for consistency instead of the absolute truth of the hypothesis.

Typical applications of NLI include:

  • NLI can be used to check if a given piece of text is consistent with the rest of the text. For example, if a new response from a chatbot or AI assistant contradicts something that was said earlier in the conversation.
  • It can be used to check if a summarization contradicts the original text in some way.
  • It can be used to check if the documents in the ranked list of results entail the query.
  • It can be used to check if a piece of text is supported by some facts. Note that this is not the same as using logic.

[!IMPORTANT] The quality of the results depends a lot on the model (the LLM) that is used. A good strategy is to first fine-tune the model using a dataset of premise-hypothesis-label triples that are relevant to your application domain.

Main Features of Omni-NLI

  • Helps mitigate LLM hallucinations by verifying if the generated content is supported by facts
  • Supports models provided by different backends, including Ollama, HuggingFace (public and private/gated models), and OpenRouter
  • Supports REST API (for traditional applications) and MCP (for AI agents) interfaces
  • Fully configurable and very scalable, with built-in caching
  • Provides confidence scores and (optional) reasoning traces for explainability

See ROADMAP.md for the list of implemented and planned features.

[!IMPORTANT] Omni-NLI is in early development, so bugs and breaking changes are expected. Please use the issues page to report bugs or request features.


Quickstart

1. Installation
sh
pip install omni-nli[huggingface]
2. Start the Server
sh
omni-nli
3. Evaluate NLI (with REST API)
sh
curl -X POST \  -H "Content-Type: application/json" \  -d '{    "premise": "A football player kicks a ball into the goal.",    "hypothesis": "The football player is asleep on the field."  }' \  http://127.0.0.1:8000/api/v1/nli/evaluate

Example response:

json
{    "label": "contradiction",    "confidence": 0.99,    "model": "microsoft/Phi-3.5-mini-instruct",    "backend": "huggingface"}
4. Evaluate NLI (with MCP Interface)

[lm_studio_mcp_usage_example_1.png]


Documentation

Check out the Omni-NLI Documentation for more information, including configuration options, API reference, and examples.


Contributing

Contributions are always welcome! Please see CONTRIBUTING.md for details on how to get started.

License

Omni-NLI is licensed under the MIT License (see LICENSE).

Acknowledgements

  • The logo is from SVG Repo with some modifications.

來源:README.md,提交 943c1f2

工具

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

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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