Skip to content

docs: add semantix-ai integration page#25490

Open
labrat-akhona wants to merge 2 commits into
BerriAI:mainfrom
labrat-akhona:docs/semantix-integration
Open

docs: add semantix-ai integration page#25490
labrat-akhona wants to merge 2 commits into
BerriAI:mainfrom
labrat-akhona:docs/semantix-integration

Conversation

@labrat-akhona

Copy link
Copy Markdown

Summary

  • Adds integration documentation for semantix-ai — validates LLM outputs from any LiteLLM-supported model against natural language intents using local NLI models
  • Works with all 100+ LiteLLM providers — validate meaning, not just structure (~15ms, zero API cost)

PyPI: pypi.org/project/semantix-ai
Repository: github.com/labrat-akhona/semantix-ai

Adds MDX integration guide for semantix-ai — a semantic type system that
validates LLM outputs against natural language intents using local NLI
models (~15ms, zero API cost). Works with all LiteLLM-supported providers
via litellm.completion(). Also registers the page in the Agent SDKs
sidebar section alongside the existing letta entry.
@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 10, 2026 2:24pm

Request Review

@greptile-apps

greptile-apps Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a documentation page for semantix-ai, a third-party library that validates LiteLLM outputs against natural-language intents using local NLI models, and registers it in the sidebar. The two issues flagged in previous review threads (unused MDX imports and global api_base mutation) have both been resolved in the current revision.

Confidence Score: 5/5

Documentation-only PR with no code changes; safe to merge.

Both issues from the prior review round (unused MDX imports, global api_base mutation) have been removed. All remaining observations are purely style-level and do not block merge.

No files require special attention.

Important Files Changed

Filename Overview
docs/my-website/docs/integrations/semantix.md New integration doc for semantix-ai; clean MDX (no unused imports, no global mutations), code examples are consistent and coherent.
docs/my-website/sidebars.js Single line addition registering integrations/semantix in the Agent SDKs & integrations sidebar section, consistent with neighbouring entries like integrations/letta.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User Code"] -->|"@validate_intent"| B["semantix-ai decorator"]
    B -->|"litellm.completion()"| C["LiteLLM Router"]
    C -->|"API call"| D["LLM Provider\n(OpenAI / Anthropic / Azure / etc.)"]
    D -->|"raw text response"| C
    C -->|"response.choices[0].message.content"| B
    B -->|"NLI inference\n(~15 ms, local)"| E{"Intent match?"}
    E -->|"Yes"| F["Return result to caller"]
    E -->|"No, retries left"| G["Inject semantix_feedback\ninto next prompt"]
    G --> B
    E -->|"No, retries exhausted"| H["Raise SemanticIntentError"]
    B -->|"collector present"| I["TrainingCollector\n(JSONL log)"]
Loading

Reviews (2): Last reviewed commit: "fix: rewrite with correct semantix-ai AP..." | Re-trigger Greptile

Comment on lines +1 to +2
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unused MDX imports

Tabs and TabItem are imported but never used anywhere in the document. In Docusaurus MDX these unused imports generate build warnings and, depending on the ESLint/MDX configuration, can cause CI failures. Remove them unless tab-based examples are planned.

Suggested change
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

from semantix import validate_intent

# Point LiteLLM SDK at your proxy
litellm.api_base = "http://localhost:4000"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Global api_base mutation in example code

Setting litellm.api_base at module level mutates a global that affects every subsequent litellm.completion() call in the same process. The idiomatic LiteLLM proxy approach is to pass api_base per-call or use environment variables. As written, the example could mislead users into inadvertently routing all their calls through the proxy. Consider using the per-call form:

Suggested change
litellm.api_base = "http://localhost:4000"
response = litellm.completion(
model="gpt-4",
api_base="http://localhost:4000",
messages=[...],
)

@codspeed-hq

codspeed-hq Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing labrat-akhona:docs/semantix-integration (b3c9726) with main (9e6d2d2)

Open in CodSpeed

@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@CLAassistant

CLAassistant commented Apr 10, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ labrat-akhona
❌ Akhona
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Tip:

Greploop — Automatically fix all review issues by running /greploops in Claude Code. It iterates: fix, push, re-review, repeat until 5/5 confidence.

Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal.

@labrat-akhona

Copy link
Copy Markdown
Author

Quick update from my side, plus a question for the maintainers.

Diagnosis on the failing lint check: the run from 2026-04-10 fails on 331 LiteLLM-owned Python files, none of which are touched by this PR (which only adds a markdown doc page and a sidebars.js entry). I checked the latest code-quality and lint jobs on recent merged PRs (e.g. #27958) and both are green now, so I'd been planning to rebase this PR onto current main and let it ride.

But: the rebase reveals the docs structure has been substantially restructured since this PR was filed:

  • docs/my-website/docs/integrations/ — the target directory for this PR — has been removed on main.
  • docs/my-website/sidebars.js — also gone.
  • The remaining doc surface under docs/my-website/docs/ is providers/ (for LLM providers) and proxy/ (for proxy-server config).

semantix-ai isn't an LLM provider or a proxy config — it's a complementary validator that consumes LLM outputs (post-generation NLI check on litellm.completion(...)'s return value). Question for @krrishdholakia / @ishaan-jaff: is there a canonical location for this style of integration doc in the new structure, or would you prefer this PR be closed?

Happy to refile against whatever the right path is, or to close this cleanly if non-provider integrations are out of scope for the LiteLLM monorepo's docs going forward. Either way I appreciate the maintainership.

(For context, semantix-ai is on PyPI as semantix-ai, repo at https://github.com/labrat-akhona/semantix-ai — same content as the originally-proposed doc page can be hosted there if that's the preferred channel.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants