Skip to content

feat(models): Add realistic model profiles from models.dev#12

Merged
chaliy merged 6 commits intomainfrom
claude/realistic-openai-models-E1FSy
Jan 17, 2026
Merged

feat(models): Add realistic model profiles from models.dev#12
chaliy merged 6 commits intomainfrom
claude/realistic-openai-models-E1FSy

Conversation

@chaliy
Copy link
Copy Markdown
Owner

@chaliy chaliy commented Jan 17, 2026

Summary

  • Add comprehensive model profiles with realistic specifications from models.dev
  • The /openai/v1/models endpoint now returns context_window and max_output_tokens for each model
  • Includes 25+ models across GPT-5, O-series, GPT-4, and Claude families
  • Add list_models.py example demonstrating the new endpoint

Changes

  • New src/openai/models.rs: Static model registry with profiles baked in at compile time
  • Extended Model struct: Added context_window and max_output_tokens fields
  • Updated handlers: list_models and get_model now return realistic profiles
  • New example: examples/list_models.py showing model profiles grouped by owner
  • CI: Added list_models example to the examples job
  • Docs: Updated architecture.md with model profiles documentation

Example Response

{
  "id": "gpt-5",
  "object": "model",
  "created": 1754524800,
  "owned_by": "openai",
  "context_window": 400000,
  "max_output_tokens": 128000
}

Test Plan

  • All existing tests pass
  • New unit tests for model profiles
  • list_models.py example runs successfully
  • cargo clippy and cargo fmt pass

Change endpoint structure from /v1/... to /{provider}/v1/...:

- /openai/v1/chat/completions
- /openai/v1/models
- /openai/v1/models/:model_id
- /openai/v1/responses
- /openresponses/v1/responses

Both /openai/v1/responses and /openresponses/v1/responses use the
same handler since the APIs are compatible.
- Update OpenAI examples to use /openai/v1/ base path
- Add OpenResponses Python example (openresponses_client.py)
- Update examples/README.md with comprehensive API documentation
- Include quick API test examples with curl commands
Add comprehensive model profiles with context windows and capabilities
sourced from models.dev. The /openai/v1/models endpoint now returns
realistic model data including:

- context_window: Maximum input token limit (e.g., 400K for GPT-5)
- max_output_tokens: Maximum response length (e.g., 128K for GPT-5)
- Accurate created timestamps and owned_by values
- Model capabilities (function_calling, vision, json_mode, reasoning)

This prepares for future context window limit emulation.

Models covered:
- GPT-5 family (gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-codex, etc.)
- O-series reasoning models (o3, o3-mini, o4-mini)
- GPT-4 family (gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini, gpt-4.1)
- Claude family (claude-3.5-sonnet through claude-opus-4.5)
The examples README should only contain examples, not API specs.
Model profile documentation is already in specs/architecture.md.
Demonstrates the /openai/v1/models endpoint which returns realistic
model profiles from models.dev, including context_window and
max_output_tokens fields.

Added to CI examples job.
Document the extended model fields (context_window, max_output_tokens)
returned by the /openai/v1/models endpoint, sourced from models.dev.
@chaliy chaliy merged commit 588522d into main Jan 17, 2026
8 checks passed
@chaliy chaliy deleted the claude/realistic-openai-models-E1FSy branch January 17, 2026 19:52
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.

2 participants