Add built-in Anthropic (Claude 5) and xAI (Grok 4.6) providers - #523
Open
jaideepkumar69-tech wants to merge 1 commit into
Open
Add built-in Anthropic (Claude 5) and xAI (Grok 4.6) providers#523jaideepkumar69-tech wants to merge 1 commit into
jaideepkumar69-tech wants to merge 1 commit into
Conversation
Route claude-* model IDs to the Anthropic Messages API and grok-* IDs to xAI's OpenAI-compatible endpoint. Factory picks ANTHROPIC_API_KEY and XAI_API_KEY. Defaults are claude-sonnet-5 and grok-4.6.
jaideepkumar69-tech
force-pushed
the
feat/anthropic-xai-providers
branch
from
August 20, 2026 05:08
65f7e8b to
2c7a920
Compare
jaideepkumar69-tech
marked this pull request as ready for review
August 20, 2026 05:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add first-class built-in providers so
lx.extract(model_id="claude-sonnet-5")andlx.extract(model_id="grok-4.6")auto-route, matching Gemini / OpenAI / Ollama.AnthropicLanguageModel— Anthropic Messages API (claude-*). Defaultclaude-sonnet-5; alsoclaude-opus-5,claude-fable-5,claude-haiku-4-5.XAILanguageModel— OpenAI-compatible client athttps://api.x.ai/v1(grok-*). Defaultgrok-4.6.ANTHROPIC_API_KEY/XAI_API_KEY(falls back toLANGEXTRACT_API_KEY).Does not change
pyproject.toml(protected infrastructure). Claude needspip install anthropic; Grok reuseslangextract[openai].This extends the provider-registry work discussed in the community-supported provider thread.
Related to #99
Related to #522
Related to #187
Feature
How Has This Been Tested?
51 passed. Coverage includes:
claude-sonnet-5/claude-opus-5/claude-fable-5/claude-haiku-4-5route toAnthropicLanguageModelgrok-4.6/grok-4.5route toXAILanguageModelAlso ran pyink on the new/changed Python files. CI: format-check and unit tests + pylint on 3.10 / 3.11 / 3.12.
Checklist:
Code of conduct.
Contributing
page, and I either signed the Google
Individual CLA
or am covered by my company's
Corporate CLA.
issue(s) and we have agreed upon the general approach.
issue(s) that documentation elsewhere needs updating.
Google's Python Style Guide
and ran
pylintover the affected code.