Skip to content

feat(models): add o1 model with OpenAI provider - #376

Merged
steebchen merged 1 commit into
mainfrom
feat/models
Jun 21, 2025
Merged

feat(models): add o1 model with OpenAI provider#376
steebchen merged 1 commit into
mainfrom
feat/models

Conversation

@steebchen

@steebchen steebchen commented Jun 21, 2025

Copy link
Copy Markdown
Member

Introduced new o1 model with OpenAI provider support. Configured pricing, context size, and streaming capabilities.

Summary by CodeRabbit

  • New Features
    • Added support for a new "o1" model with enhanced context size, streaming capability, and JSON output mode.

Introduced new `o1` model with OpenAI provider support.
Configured pricing, context size, and streaming capabilities.
@coderabbitai

coderabbitai Bot commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A new entry for the "o1" model, provided by "openai," was added to the exported models array. This entry specifies pricing, context size, streaming capability, and JSON output support. No other changes were made to existing models or interfaces.

Changes

File(s) Change Summary
packages/models/src/models.ts Added a new "o1" model definition to the exported models array with pricing and capabilities

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ModelsModule

  Client->>ModelsModule: Request available models
  ModelsModule-->>Client: Return models array (includes new "o1" model)
Loading

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@claude

claude Bot commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

Claude finished @steebchen's task —— View job


Code Review for PR #376

Completed comprehensive review of the o1 model addition.

Tasks:

  • Read current models.ts file structure
  • Create pending PR review
  • Get PR diff to analyze exact changes
  • Analyze changes for potential issues
  • Add inline comments if needed
  • Submit review with feedback

Review Summary:

The PR adds o1 model configuration following existing patterns. Two critical issues identified:

  1. Streaming set to true - o1 models don't support streaming (should be false)
  2. JSON output capability - needs verification before enabling

Overall code quality is good, just needs capability flags corrected to match OpenAI's o1 specifications.

Review submitted with detailed inline comments and recommendations.


@steebchen
steebchen enabled auto-merge June 21, 2025 21:59

@claude claude Bot left a comment

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.

Code Review Summary

The o1 model addition follows the existing code patterns and structure well. However, there are two important capability issues that need attention:

  1. Streaming: o1 models don't support streaming - should be false
  2. JSON Output: Verify structured output support before enabling

Positive Aspects:

  • ✅ Consistent with existing model definitions
  • ✅ Pricing appears accurate ($15/1M input, $60/1M output)
  • ✅ Context size (200K tokens) is appropriate
  • ✅ Proper TypeScript typing maintained

Recommendations:

  • Fix the streaming capability to false
  • Verify JSON output support or set to false if unsupported
  • Consider adding tests for the new model configuration

The overall implementation quality is good - just needs the capability flags corrected to match OpenAI's o1 model specifications.

inputPrice: 15.0 / 1e6,
outputPrice: 60.0 / 1e6,
contextSize: 200000,
streaming: true,

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.

🚨 Streaming Support Issue: OpenAI's o1 models do not support streaming responses. This should be set to false.

According to OpenAI's documentation, o1 models generate responses in a single completion and don't support streaming chunks. Setting this to true may cause runtime errors or unexpected behavior.

streaming: true,
},
],
jsonOutput: true,

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.

⚠️ JSON Output Capability: Consider verifying if o1 models fully support structured JSON output mode.

While o1 models can generate JSON in their responses, they may have limitations with OpenAI's structured output features (like response_format: { "type": "json_object" }). You may want to test this capability or set to false if unsupported to avoid runtime issues.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/models/src/models.ts (1)

139-152: Consider grouping o-series models together
For consistency and readability, you might reorder entries so that all o-series models (o1, o3, o3-mini) appear consecutively under the OpenAI provider.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 403aefc and 6db8317.

📒 Files selected for processing (1)
  • packages/models/src/models.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: claude-review
  • GitHub Check: build / run
  • GitHub Check: e2e / run
  • GitHub Check: test / run
🔇 Additional comments (1)
packages/models/src/models.ts (1)

139-152: Validate o1 model’s pricing and context parameters
Ensure the inputPrice (15.0/1e6), outputPrice (60.0/1e6), and contextSize (200000) correspond to OpenAI’s official o1 model specifications.

What are the official input/output token prices and maximum context size for OpenAI’s “o1” model according to the latest OpenAI documentation?

@steebchen
steebchen added this pull request to the merge queue Jun 21, 2025
Merged via the queue into main with commit 21f9644 Jun 21, 2025
@steebchen
steebchen deleted the feat/models branch June 21, 2025 22:03
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