Skip to content

fix(models): update pricing and add test skip flags - #993

Merged
steebchen merged 1 commit into
mainfrom
fix/models
Oct 7, 2025
Merged

steebchen merged 1 commit into
mainfrom
fix/models

Conversation

@steebchen

@steebchen steebchen commented Oct 6, 2025

Copy link
Copy Markdown
Member

Updated pricing calculations for Perplexity models. Added test: "skip" flags for specific provider configurations to improve testing workflow. Adjusted deactivation dates.

Summary by CodeRabbit

  • New Features

    • Added an alternate discounted access route for GPT-5, offering lower-cost usage.
  • Chores

    • Updated pricing for Perplexity Sonar models to reflect new rates.
    • Set a deactivation date for Gemma2 9B IT, clarifying its availability timeline.
  • Tests

    • Marked select providers/models across vendors to be skipped in test runs (no impact on production behavior).

Updated pricing calculations for Perplexity models. Added `test: "skip"` flags for specific provider configurations
to improve testing workflow. Adjusted deactivation dates.
@bunnyshell

bunnyshell Bot commented Oct 6, 2025

Copy link
Copy Markdown

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@coderabbitai

coderabbitai Bot commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds test: "skip" flags to multiple provider entries across Anthropic, OpenAI, and xAI models; introduces an alternate discount provider for GPT-5; updates a Google model’s deactivation date; and normalizes Perplexity pricing values using fractional expressions. No control-flow code changes; only configuration/data updates.

Changes

Cohort / File(s) Summary of changes
Anthropic provider test flags
packages/models/src/models/anthropic.ts
Added test: "skip" to several provider objects across multiple Claude model entries without altering pricing or control fields.
OpenAI GPT-5 providers
packages/models/src/models/openai.ts
Added test: "skip" to the first GPT-5 provider and introduced a second GPT-5 provider (routeway-discount) with discount: 0.5 and test: "skip".
Perplexity pricing normalization
packages/models/src/models/perplexity.ts
Replaced decimal literals with fractional expressions for inputPrice/outputPrice/requestPrice on sonar, sonar-pro, sonar-reasoning-pro; no structural changes.
xAI provider test flags
packages/models/src/models/xai.ts
Added test: "skip" to provider entries for grok-3, grok-2-1212, and grok-code-fast-1.
Google model deactivation date
packages/models/src/models/google.ts
Set deactivatedAt for gemma2-9b-it to 2025-10-08.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant R as Model Router
  participant P as Provider

  rect rgb(238,245,255)
    note over R: Filter providers where provider.test !== "skip"
    C->>R: Request (modelId)
    R->>R: Resolve model providers
    R->>R: Exclude test: "skip"
  end

  alt OpenAI gpt-5
    opt Routeway discount available
      note over R: Select discount provider if eligible
    end
    R->>P: Forward request (pricing/context per provider)
    P-->>R: Response
  else Other providers
    R->>P: Forward request
    P-->>R: Response
  end

  R-->>C: Response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

auto-merge

Suggested reviewers

  • smakosh

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the key updates in the PR by noting both the pricing adjustments and addition of test skip flags, aligning with the bulk of changes across model configurations without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 fix/models

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.

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99a0145 and 0e6a0a8.

📒 Files selected for processing (5)
  • packages/models/src/models/anthropic.ts (5 hunks)
  • packages/models/src/models/google.ts (1 hunks)
  • packages/models/src/models/openai.ts (1 hunks)
  • packages/models/src/models/perplexity.ts (3 hunks)
  • packages/models/src/models/xai.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: This is a pure TypeScript project—do not use any or as any unless absolutely necessary
Always use top-level ES imports; never use require or dynamic import()

Files:

  • packages/models/src/models/google.ts
  • packages/models/src/models/openai.ts
  • packages/models/src/models/perplexity.ts
  • packages/models/src/models/xai.ts
  • packages/models/src/models/anthropic.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Always use top-level import; never use require() or dynamic import()

Files:

  • packages/models/src/models/google.ts
  • packages/models/src/models/openai.ts
  • packages/models/src/models/perplexity.ts
  • packages/models/src/models/xai.ts
  • packages/models/src/models/anthropic.ts
⏰ 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). (9)
  • GitHub Check: test / run
  • GitHub Check: lint / run
  • GitHub Check: generate / run
  • GitHub Check: build / run
  • GitHub Check: e2e-shards (4)
  • GitHub Check: e2e-shards (1)
  • GitHub Check: e2e-shards (2)
  • GitHub Check: e2e-shards (3)
  • GitHub Check: autofix
🔇 Additional comments (5)
packages/models/src/models/xai.ts (1)

12-12: LGTM!

The addition of test: "skip" flags to these provider entries is consistent with the PR's objective to improve testing workflows by allowing selective test skipping.

Also applies to: 102-102, 243-243

packages/models/src/models/openai.ts (1)

398-422: LGTM!

The addition of the routeway-discount provider for GPT-5 follows the established pattern seen in other models (e.g., GPT-5 Mini, GPT-5 Nano). The configuration includes the reasoningOutput: "omit" field specific to the discount path, which is consistent with similar entries.

packages/models/src/models/google.ts (1)

506-506: Verify the deactivation date.

The deactivatedAt date is set to October 8, 2025, which is in the recent past. Please confirm this date is correct and that the model should indeed be deactivated at this time.

packages/models/src/models/perplexity.ts (1)

62-63: LGTM!

The pricing representation has been normalized to use fractional expressions, which improves consistency with other models in the codebase.

packages/models/src/models/anthropic.ts (1)

72-72: LGTM!

The addition of test: "skip" flags to these Claude model provider entries is consistent with the PR's objective to improve testing workflows. This allows for selective test execution without affecting the model configurations themselves.

Also applies to: 87-87, 113-113, 198-198, 213-213

Comment on lines +14 to +16
inputPrice: 2 / 1e6,
outputPrice: 8 / 1e6,
requestPrice: 5.0 / 1000,

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the pricing changes for sonar-reasoning-pro.

The changes introduce actual pricing modifications, not just formatting:

  • Input price decreased: from $3/M tokens to $2/M tokens
  • Output price decreased: from $10/M tokens to $8/M tokens
  • Request price increased: from $0 to $5 per 1,000 requests

Please confirm these pricing changes are intentional and accurate according to Perplexity's current pricing.


🌐 Web query:

What are the current pricing rates (input token price USD, output token price USD, request price per 1,000 requests) for Perplexity AI’s sonar-reasoning-pro and sonar-pro plans?

💡 Result:

As of Oct 6, 2025 — Perplexity's docs list:

  • Sonar Reasoning Pro: input $2 per 1M tokens; output $8 per 1M tokens; request fee (per 1K requests) = $14 / $10 / $6 for High / Medium / Low search-context sizes. [1]

  • Sonar Pro: input $3 per 1M tokens; output $15 per 1M tokens; request fee (per 1K requests) = $14 / $10 / $6 for High / Medium / Low search-context sizes. [2]

Sources: Perplexity model docs — Sonar Reasoning Pro and Sonar Pro. [1] (docs.perplexity.ai) [2] (docs.perplexity.ai)

Citations:


Align requestPrice with published tiered fees.

The current requestPrice: 5.0/1000 ($5/1K) does not match Perplexity’s documented rates ($14/1K, $10/1K, $6/1K for High/Medium/Low). Update both the Sonar Reasoning Pro and Sonar Pro entries in packages/models/src/models/perplexity.ts to reflect these three tiers.

🤖 Prompt for AI Agents
In packages/models/src/models/perplexity.ts around lines 14 to 16, replace the
incorrect requestPrice value (5.0/1000) for both Sonar Reasoning Pro and Sonar
Pro entries with tiered rates matching Perplexity docs: set High to 14/1000,
Medium to 10/1000, and Low to 6/1000 (keep inputPrice/outputPrice unchanged);
ensure each entry's requestPrice reflects the appropriate High/Medium/Low tier
numeric value (e.g., 14/1000) instead of the old 5.0/1000.

Comment on lines +38 to +40
inputPrice: 3 / 1e6,
outputPrice: 15 / 1e6,
requestPrice: 5.0 / 1000,

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the request price increase for sonar-pro.

The requestPrice changed from 0 to 5.0 / 1000 ($5 per 1,000 requests). Please confirm this pricing change is intentional and matches Perplexity's current pricing.


🌐 Web query:

What is Perplexity AI’s current sonar-pro API pricing per 1,000 requests?

💡 Result:

Sonar Pro request fee: $14 / $10 / $6 per 1,000 requests for High / Medium / Low search-context sizes. [1][2]


Align Sonar Pro requestPrice with official pricing
The snippet sets requestPrice: 5.0 / 1000 ($5 per 1 000), but Perplexity’s current Sonar Pro fees are $6/$10/$14 per 1 000 requests (low/medium/high search-context). Confirm which tier applies and update requestPrice to match.

🤖 Prompt for AI Agents
In packages/models/src/models/perplexity.ts around lines 38 to 40, the
requestPrice is set to 5.0/1000 but Perplexity Sonar Pro pricing is $6/$10/$14
per 1,000 requests depending on tier; confirm which Sonar Pro tier
(low/medium/high search‑context) this model should use and update requestPrice
to the matching numeric value (e.g., 6.0/1000, 10.0/1000, or 14.0/1000) so the
constant reflects the official per‑1k price.

@steebchen
steebchen added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit 01c07a5 Oct 7, 2025
18 checks passed
@steebchen
steebchen deleted the fix/models branch October 7, 2025 00:43
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