Skip to content

Comments

Only use gemini 2.5 pro in custom mode#529

Merged
elie222 merged 1 commit intomainfrom
chore/move-custom-to-gemini
Jun 27, 2025
Merged

Only use gemini 2.5 pro in custom mode#529
elie222 merged 1 commit intomainfrom
chore/move-custom-to-gemini

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Jun 27, 2025

Summary by CodeRabbit

  • New Features
    • Added support for cost calculation with the Google Gemini 2.5 Pro model.
  • Improvements
    • Updated the Google Gemini model option to use the latest non-preview version.
  • Other
    • Disabled selection of certain Anthropic Bedrock Sonnet models when using a custom provider without a user API key.
    • Incremented the app version to v1.7.14.

@vercel
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
inbox-zero ✅ Ready (Inspect) Visit Preview Jun 27, 2025 11:33am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Walkthrough

This update revises the Gemini model string to "google/gemini-2.5-pro" in model selection and cost mapping, disables two Anthropic Bedrock Sonnet models by commenting them out, increments the app version, and updates a subproject commit reference for the marketing app.

Changes

File(s) Change Summary
apps/web/utils/llms/model.ts Disabled two Anthropic Bedrock Sonnet models; updated Gemini model string in OpenRouter provider logic.
apps/web/utils/usage.ts Added cost mapping for "google/gemini-2.5-pro" model.
apps/web/app/(marketing) Updated subproject commit reference.
version.txt Incremented version from v1.7.13 to v1.7.14.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant ModelSelector
    participant CostCalculator

    User->>App: Request LLM model usage
    App->>ModelSelector: Select model (OpenRouter provider)
    ModelSelector-->>App: Returns "google/gemini-2.5-pro"
    App->>CostCalculator: Calculate cost for "google/gemini-2.5-pro"
    CostCalculator-->>App: Returns cost
    App-->>User: Responds with result and cost
Loading

Possibly related PRs

  • Add Google Gemini Support #297: Adds initial Google Gemini support, including model constants, provider handling, and cost entries in the same utility files.
  • Pass to to LLM #474: Involves changes to email data structures and functions, focusing on email data consistency for AI processing.
  • Default llm model env var #500: Modifies model selection and configuration logic in model.ts and cost mappings in usage.ts, closely related to the current changes.

Poem

A hop, a skip, a Gemini tune,
New models shine beneath the moon.
Anthropic Sonnet takes a rest,
Gemini’s cost now stands the test.
Version hops up, the code is spry—
Rabbits cheer as updates fly!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/utils/llms/model.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

apps/web/utils/usage.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d1b814a and c947f48.

📒 Files selected for processing (4)
  • apps/web/app/(marketing) (1 hunks)
  • apps/web/utils/llms/model.ts (3 hunks)
  • apps/web/utils/usage.ts (1 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
`apps/web/**/app/**`: Follow NextJS app router structure by organizing code within the app directory.

apps/web/**/app/**: Follow NextJS app router structure by organizing code within the app directory.

📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md)

List of files the instruction was applied to:

  • apps/web/app/(marketing)
`apps/web/**`: Install packages only within the 'apps/web' directory, not at the repository root.

apps/web/**: Install packages only within the 'apps/web' directory, not at the repository root.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/installing-packages.mdc)

List of files the instruction was applied to:

  • apps/web/app/(marketing)
  • apps/web/utils/usage.ts
  • apps/web/utils/llms/model.ts
`apps/web/**/*.{ts,tsx}`: Use TypeScript with strict null checks enabled. Use pa...

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks enabled.
Use path aliases with @/ for imports from the project root.
Use proper error handling with try/catch blocks.
Use the LoadingContent component for async data loading states.
Prefix client-side environment variables with NEXT_PUBLIC_.

📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md)

List of files the instruction was applied to:

  • apps/web/utils/usage.ts
  • apps/web/utils/llms/model.ts
`apps/web/**/*.{ts,tsx,js,jsx}`: Format code with Prettier and follow tailwindcss patterns using prettier-plugin-tailwindcss.

apps/web/**/*.{ts,tsx,js,jsx}: Format code with Prettier and follow tailwindcss patterns using prettier-plugin-tailwindcss.

📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md)

List of files the instruction was applied to:

  • apps/web/utils/usage.ts
  • apps/web/utils/llms/model.ts
`apps/web/utils/usage.ts`: This file should handle usage tracking and monitoring.

apps/web/utils/usage.ts: This file should handle usage tracking and monitoring.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/llm.mdc)

List of files the instruction was applied to:

  • apps/web/utils/usage.ts
`apps/web/utils/**/*`: Create utility functions in utils/ folder for reusable logic.

apps/web/utils/**/*: Create utility functions in utils/ folder for reusable logic.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)

List of files the instruction was applied to:

  • apps/web/utils/usage.ts
  • apps/web/utils/llms/model.ts
`**/*.{js,jsx,ts,tsx}`: Use Shadcn UI and Tailwind for components and styling. I...

**/*.{js,jsx,ts,tsx}: Use Shadcn UI and Tailwind for components and styling.
Implement responsive design with Tailwind CSS using a mobile-first approach.
Use the next/image package for images.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/ui-components.mdc)

List of files the instruction was applied to:

  • apps/web/utils/usage.ts
  • apps/web/utils/llms/model.ts
`apps/web/utils/llms/**`: Core LLM utilities and configurations should be placed in this directory.

apps/web/utils/llms/**: Core LLM utilities and configurations should be placed in this directory.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/llm.mdc)

List of files the instruction was applied to:

  • apps/web/utils/llms/model.ts
`apps/web/utils/llms/model.ts`: This file should contain model definitions and configurations.

apps/web/utils/llms/model.ts: This file should contain model definitions and configurations.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/llm.mdc)

List of files the instruction was applied to:

  • apps/web/utils/llms/model.ts
🧠 Learnings (1)
apps/web/utils/llms/model.ts (2)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/llm-test.mdc:0-0
Timestamp: 2025-06-23T12:26:27.693Z
Learning: When writing tests for LLM-related functionality in TypeScript (e.g., in 'apps/web/__tests__/*.test.ts'), always create helper functions for common test data to ensure consistency and reduce duplication.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/prisma.mdc:0-0
Timestamp: 2025-06-23T12:26:53.882Z
Learning: In this project, Prisma should be imported using 'import prisma from "@/utils/prisma";' in TypeScript files.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Static Code Analysis Js
  • GitHub Check: Jit Security
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (7)
version.txt (1)

1-1: Version bump looks fine – double-check release artifacts.

version.txt now shows v1.7.14. Make sure the same version is reflected in CHANGELOG / package manifests and that CI/CD pipelines pick it up for tagging & publishing.

apps/web/app/(marketing) (1)

1-1: Submodule pointer updated – please validate downstream build

The update only changes the commit SHA of the (marketing) sub-project. That’s fine, but double-check that:

  1. The referenced commit b1da49a83a… is pushed to the remote and publicly reachable.
  2. CI/CD images that rely on shallow clones run git submodule update --init --recursive so they pull the new revision.

No code issues spotted.

apps/web/utils/usage.ts (1)

124-124: LGTM: Cost mapping added for stable Gemini 2.5 Pro model.

The addition properly maps the stable version of Gemini 2.5 Pro to the existing cost configuration, enabling accurate cost tracking for the updated model identifier.

apps/web/utils/llms/model.ts (4)

193-200: Consider the impact of removing fallback model options.

Commenting out the Bedrock Sonnet models reduces the available options in custom mode from 3 to 1. This achieves the PR objective but may impact service resilience and load distribution.

Consider implementing a gradual rollout or monitoring to ensure the single model option can handle the full load effectively.


219-219: LGTM: Model string updated to stable version.

The update from preview to stable Gemini 2.5 Pro version is consistent with the cost mapping changes in usage.ts.


228-228: LGTM: Provider options updated consistently.

The model string in the OpenRouter provider options is properly updated to match the random selection logic above.


219-219: Verify that the stable Gemini 2.5 Pro model is available and functional.

Ensure that the new model identifier "google/gemini-2.5-pro" is valid and available through OpenRouter before deploying this change.

#!/bin/bash
# Description: Verify if the Gemini 2.5 Pro model is available and check for any related configuration issues

# Check if there are any references to the old preview model that might need updating
echo "=== Searching for old preview model references ==="
rg "google/gemini-2.5-pro-preview" --type=ts --type=tsx

# Check for any hardcoded model references that might conflict
echo "=== Searching for other Gemini 2.5 Pro references ==="
rg "gemini-2.5-pro" --type=ts --type=tsx -A 2 -B 2

# Look for any environment variable configurations related to these models
echo "=== Checking environment configurations ==="
fd -e env -e example | xargs rg -l "gemini\|GEMINI" 2>/dev/null || echo "No env files found with Gemini references"

Also applies to: 228-228

✨ 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.

@elie222 elie222 merged commit a117458 into main Jun 27, 2025
10 checks passed
@elie222 elie222 deleted the chore/move-custom-to-gemini branch December 18, 2025 23:00
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