Skip to content

feat: add Claude 4, OpenAI o-series, xAI Grok, and DeepSeek to KnownModelName#2235

Open
GopalGB wants to merge 1 commit into567-labs:mainfrom
GopalGB:add-claude-4-model-names
Open

feat: add Claude 4, OpenAI o-series, xAI Grok, and DeepSeek to KnownModelName#2235
GopalGB wants to merge 1 commit into567-labs:mainfrom
GopalGB:add-claude-4-model-names

Conversation

@GopalGB
Copy link
Copy Markdown

@GopalGB GopalGB commented Mar 31, 2026

Summary

  • Add 24 missing model entries to the KnownModelName type alias in instructor/models.py

Models Added

Anthropic Claude 4 family:

  • claude-opus-4-0-20250514
  • claude-sonnet-4-0-20250514
  • claude-sonnet-4-6-20250627
  • claude-haiku-4-0-20250414

OpenAI o-series (reasoning models):

  • o1, o1-mini, o1-preview (with dated variants)
  • o3, o3-mini (with dated variants)
  • o4-mini

xAI (Grok):

  • grok-3, grok-3-fast, grok-3-mini, grok-3-mini-fast

DeepSeek:

  • deepseek-chat, deepseek-reasoner

Motivation

These providers are all listed in supported_providers and work with from_provider(), but their models were not included in the KnownModelName Literal type. This means:

  • IDE autocompletion doesn't suggest these models
  • Static type checkers flag them as invalid
  • Users have to use raw str instead of getting type-safe model names

Test plan

  • Verify from_provider("anthropic/claude-sonnet-4-6-20250627") works
  • Verify from_provider("openai/o3-mini") works
  • Verify from_provider("xai/grok-3") works
  • Verify from_provider("deepseek/deepseek-chat") works
  • Type checker validates the new literal values

…odelName

Add missing model entries to the KnownModelName type alias:

Anthropic:
- claude-opus-4-0-20250514
- claude-sonnet-4-0-20250514
- claude-sonnet-4-6-20250627
- claude-haiku-4-0-20250414

OpenAI o-series (reasoning models):
- o1, o1-mini, o1-preview (with dated variants)
- o3, o3-mini (with dated variants)
- o4-mini

xAI (Grok):
- grok-3, grok-3-fast, grok-3-mini, grok-3-mini-fast

DeepSeek:
- deepseek-chat, deepseek-reasoner

These providers were already supported in from_provider() but their
models were not listed in KnownModelName, so IDE autocompletion
and type checking did not surface them.
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.

1 participant