Skip to content

Adjust openai example models#1016

Merged
elie222 merged 5 commits intomainfrom
chore/simpler-readme
Nov 26, 2025
Merged

Adjust openai example models#1016
elie222 merged 5 commits intomainfrom
chore/simpler-readme

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 26, 2025

Update OpenAI and Google model selections across web and unsubscriber to use gemini-2.5-flash, gpt-5-mini, and default gpt-5.1 for OpenAI

Adjust model identifiers in selection utilities and examples, set default OpenAI model to gpt-5.1, and add pricing for gpt-5-mini and gpt-5.1.

📍Where to Start

Start with llm.getModel in llm.ts, then review selectModel in model.ts and pricing in usage.ts.


Macroscope summarized 904ed29.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Google Gemini 2.5 Flash and OpenAI GPT-5 models as preferred options. Updated pricing data for new models enables accurate cost tracking and billing calculations.
  • Documentation

    • Simplified Docker Compose setup instructions by removing redundant setup alternatives and streamlining the deployment guide.
  • Chores

    • Version updated to v2.20.26.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 26, 2025 3:07pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

This PR upgrades LLM model selections across the application, transitioning to newer versions: Google Gemini 2.5-flash, OpenAI gpt-5 variants. Associated cost mappings are added, configuration files updated, Docker documentation simplified, and version incremented to v2.20.26.

Changes

Cohort / File(s) Change Summary
LLM Model Selection Updates
apps/unsubscriber/src/llm.ts, apps/web/utils/llms/model.ts
Updated model defaults for Google (gemini-1.5-flash → gemini-2.5-flash) and OpenAI (gpt-4o-mini → gpt-5-mini, gpt-4o → gpt-5.1) across getModel and selectModel functions.
Environment Configuration
apps/web/.env.example
Updated OpenAI model environment variables: DEFAULT_LLM_MODEL (gpt-4o → gpt-5.1) and ECONOMY_LLM_MODEL (gpt-4o-mini → gpt-5-mini).
Cost Mapping Updates
apps/web/utils/usage.ts
Added cost entries for new models: gpt-5-mini (input: 0.25/1M, output: 2/1M) and gpt-5.1 (input: 1.25/1M, output: 10/1M).
Documentation Simplification
docs/hosting/docker.md
Removed Option B download-via-curl workflow; simplified Docker setup section to single "Clone the repository" approach.
Version Bump
version.txt
Incremented version from v2.20.25 to v2.20.26.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify new model names (gemini-2.5-flash, gpt-5-mini, gpt-5.1) are correctly specified across all files
  • Confirm pricing data for gpt-5-mini and gpt-5.1 in usage.ts matches authoritative sources
  • Validate that model selection logic properly handles all updated model strings without breaking existing fallbacks

Possibly related PRs

Poem

🐰 Hop, skip, and jump to gemini-five,
gpt-five-mini keeps costs alive,
New prices charted, old paths removed,
Version bumped—efficiency improved!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Adjust openai example models' is vague and doesn't accurately capture the scope of changes, which include updates beyond just OpenAI examples (Google models, version bump, Docker documentation removal). Consider a more descriptive title that reflects the main changes, such as 'Update LLM model defaults and add GPT-5 cost entries' or similar, to better convey the full scope of modifications.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/simpler-readme

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The following Jit checks failed to run:

  • secret-detection
  • static-code-analysis-js

#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.

More info in the Jit platform.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/web/utils/llms/model.ts (1)

68-79: OPEN_AI fallback updated to gpt-5.1 – behavior and config stay in sync

Using aiModel || "gpt-5.1" keeps the runtime default aligned with DEFAULT_LLM_MODEL in .env.example and with the new gpt-5.1 entry in utils/usage.ts. Existing users with explicit aiModel or env overrides won’t be affected.

If you keep evolving model IDs, consider centralizing them in a shared config to avoid future drift between env, selection, and cost tables.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae8af48 and 795fd6c.

📒 Files selected for processing (6)
  • apps/unsubscriber/src/llm.ts (1 hunks)
  • apps/web/.env.example (1 hunks)
  • apps/web/utils/llms/model.ts (1 hunks)
  • apps/web/utils/usage.ts (1 hunks)
  • docs/hosting/docker.md (1 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use @/ path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type files

Import specific lodash functions rather than entire lodash library to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/utils/llms/model.ts
  • apps/web/utils/usage.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)

**/*.{ts,tsx}: For API GET requests to server, use the swr package
Use result?.serverError with toastError from @/components/Toast for error handling in async operations

**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls

**/*.{ts,tsx}: For early access feature flags, create hooks using the naming convention use[FeatureName]Enabled that return a boolean from useFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming convention use[FeatureName]Variant that define variant types, use useFeatureFlagVariantKey() with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g., inbox-cleaner, pricing-options-2)
Always define types for A/B test variant flags (e.g., type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the ! postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Use as const instead of literal types and type annotations
Use either T[] or Array<T> consistently
Initialize each enum member value explicitly
Use export type for types
Use `impo...

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
apps/web/{utils/ai,utils/llms,__tests__}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/llm.mdc)

LLM-related code must be organized in specific directories: apps/web/utils/ai/ for main implementations, apps/web/utils/llms/ for core utilities and configurations, and apps/web/__tests__/ for LLM-specific tests

Files:

  • apps/web/utils/llms/model.ts
apps/web/utils/llms/{index,model}.ts

📄 CodeRabbit inference engine (.cursor/rules/llm.mdc)

Core LLM functionality must be defined in utils/llms/index.ts, model definitions and configurations in utils/llms/model.ts, and usage tracking in utils/usage.ts

Files:

  • apps/web/utils/llms/model.ts
**/{server,api,actions,utils}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

**/{server,api,actions,utils}/**/*.ts: Use createScopedLogger from "@/utils/logger" for logging in backend code
Add the createScopedLogger instantiation at the top of the file with an appropriate scope name
Use .with() method to attach context variables only within specific functions, not on global loggers
For large functions with reused variables, use createScopedLogger().with() to attach context once and reuse the logger without passing variables repeatedly

Files:

  • apps/web/utils/llms/model.ts
  • apps/web/utils/usage.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)

Always import Prisma enums from @/generated/prisma/enums instead of @/generated/prisma/client to avoid Next.js bundling errors in client components

Import Prisma using the project's centralized utility: import prisma from '@/utils/prisma'

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/security.mdc)

**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma's select option. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. All findUnique/findFirst calls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
All findMany queries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g., emailAccount: { id: emailAccountId }) to validate ownership

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Use next/image package for images
For API GET requests to server, use the swr package with hooks like useSWR to fetch data
For text inputs, use the Input component with registerProps for form integration and error handling

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
**/*.{tsx,ts,css}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

Implement responsive design with Tailwind CSS using a mobile-first approach

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use accessKey attribute on any HTML element
Don't set aria-hidden="true" on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like <marquee> or <blink>
Only use the scope prop on <th> elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assign tabIndex to non-interactive HTML elements
Don't use positive integers for tabIndex property
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include a title element for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
Assign tabIndex to non-interactive HTML elements with aria-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include a type attribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden)
Always include a lang attribute on the html element
Always include a title attribute for iframe elements
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress
Accompany onMouseOver/onMouseOut with onFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
!(pages/_document).{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

Don't use the next/head module in pages/_document.js on Next.js projects

Files:

  • apps/web/utils/llms/model.ts
  • docs/hosting/docker.md
  • apps/unsubscriber/src/llm.ts
  • apps/web/.env.example
  • version.txt
  • apps/web/utils/usage.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
  • apps/web/utils/usage.ts
apps/web/**/{.env.example,env.ts,turbo.json}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Add environment variables to .env.example, env.ts, and turbo.json

Files:

  • apps/web/.env.example
🧠 Learnings (6)
📚 Learning: 2025-11-25T14:38:07.585Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.585Z
Learning: Applies to apps/web/utils/ai/**/*.ts : LLM feature functions must import from `zod` for schema validation, use `createScopedLogger` from `@/utils/logger`, `chatCompletionObject` and `createGenerateObject` from `@/utils/llms`, and import `EmailAccountWithAI` type from `@/utils/llms/types`

Applied to files:

  • apps/web/utils/llms/model.ts
  • apps/unsubscriber/src/llm.ts
📚 Learning: 2025-11-25T14:38:07.585Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.585Z
Learning: Applies to apps/web/utils/llms/{index,model}.ts : Core LLM functionality must be defined in `utils/llms/index.ts`, model definitions and configurations in `utils/llms/model.ts`, and usage tracking in `utils/usage.ts`

Applied to files:

  • apps/web/utils/llms/model.ts
📚 Learning: 2025-11-25T14:38:07.585Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.585Z
Learning: Applies to apps/web/utils/ai/**/*.ts : LLM feature functions must follow a standard structure: accept options with `inputData` and `emailAccount` parameters, implement input validation with early returns, define separate system and user prompts, create a Zod schema for response validation, and use `createGenerateObject` to execute the LLM call

Applied to files:

  • apps/unsubscriber/src/llm.ts
📚 Learning: 2025-11-25T14:38:07.585Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.585Z
Learning: Applies to apps/web/utils/ai/**/*.ts : Use TypeScript types for all LLM function parameters and return values, and define clear interfaces for complex input/output structures

Applied to files:

  • apps/unsubscriber/src/llm.ts
📚 Learning: 2025-11-25T14:36:45.797Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/environment-variables.mdc:0-0
Timestamp: 2025-11-25T14:36:45.797Z
Learning: Applies to .env.example : Add new environment variables to `.env.example` with example values

Applied to files:

  • apps/web/.env.example
📚 Learning: 2025-11-25T14:36:43.454Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/environment-variables.mdc:0-0
Timestamp: 2025-11-25T14:36:43.454Z
Learning: Applies to .env.example : Add environment variables to `.env.example` with example values in the format `VARIABLE_NAME=value_example`

Applied to files:

  • apps/web/.env.example
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Jit Security
🔇 Additional comments (4)
version.txt (1)

1-1: Version bump aligns with PR changes

Version update to v2.20.26 matches the model and docs adjustments in this PR; nothing else to flag here.

apps/web/.env.example (1)

44-49: OpenAI example defaults now match code and pricing configuration

Switching the commented defaults to gpt-5.1 (default) and gpt-5-mini (economy) is consistent with selectModel in utils/llms/model.ts and the new cost entries in utils/usage.ts. No extra env wiring is needed since these reuse existing variables.

docs/hosting/docker.md (1)

19-26: Docker setup docs simplification looks good

Collapsing the setup to a single “Clone the repository” flow removes branching without changing the actual commands. The instructions remain clear and accurate for the Docker compose setup.

apps/unsubscriber/src/llm.ts (1)

8-17: I'll verify the key claims in the original review comment about the missing cost mapping for gemini-2.5-flash. Let me search the codebase for the usage/costs configuration.
<function_calls>

shell

#!/bin/bash

Locate usage.ts file

fd -t f "usage.ts" --strip-cwd-prefix


</function_calls>
<function_calls>

shell

#!/bin/bash

Search for any file containing cost configuration

fd -t f "usage" | grep -E ".(ts|js)$"


</function_calls>
<function_calls>

shell

#!/bin/bash

Look for files in utils directory

find . -path "/utils/" -name "*.ts" -type f | head -20


</function_calls>
<function_calls>

shell

#!/bin/bash

Search for cost map or pricing configuration

rg -t ts "costs\s*[=:]|pricing" --max-count=10


</function_calls>
<function_calls>

shell

#!/bin/bash

Search for gemini-2.5-flash references

rg "gemini-2.5-flash|gemini2_5flash" -t ts -C 3


</function_calls>
<function_calls>

shell

#!/bin/bash

Search for gpt-5-mini and gpt-5 references

rg "gpt-5|gpt5" -t ts -C 2


</function_calls>
<function_calls>

shell

#!/bin/bash

Look at the llm.ts file to understand the structure

cat -n apps/unsubscriber/src/llm.ts


</function_calls>

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The following Jit checks failed to run:

  • secret-detection
  • static-code-analysis-js

#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.

More info in the Jit platform.

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The following Jit checks failed to run:

  • secret-detection
  • static-code-analysis-js

#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.

More info in the Jit platform.

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The following Jit checks failed to run:

  • secret-detection
  • static-code-analysis-js

#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.

More info in the Jit platform.

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The following Jit checks failed to run:

  • secret-detection
  • static-code-analysis-js

#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.

More info in the Jit platform.

@elie222 elie222 merged commit 397b9b7 into main Nov 26, 2025
14 of 18 checks passed
@elie222 elie222 deleted the chore/simpler-readme branch November 26, 2025 15:30
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

Comments