Skip to content

feat(bedrock-mantle): add custom_pricing execution modes for 20 models - #1021

Open
bhishmendramahala-crypto wants to merge 1 commit into
mainfrom
feat/bedrock-mantle-full-custom-pricing
Open

bhishmendramahala-crypto wants to merge 1 commit into
mainfrom
feat/bedrock-mantle-full-custom-pricing

Conversation

@bhishmendramahala-crypto

@bhishmendramahala-crypto bhishmendramahala-crypto commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

20 models in bedrock-mantle.json had only a flat pricing_config with no custom_pricing block. This means applyCustomPricing always ignored service_tier (priority, flex, batch, ultrafast) and billed every request at standard rates — causing systematic undercounting for non-standard tiers.

For example:

  • priority tier is typically 1.75× standard → 43% undercounting
  • flex/batch tier is typically 0.5× standard → 2× overcounting
  • ultrafast on gpt-6-astra is 6× standard → 83% undercounting

Changes

pricing/bedrock-mantle.json

Added custom_pricing with execution_modes for 20 models across 4 provider families. All prices sourced from the matching bedrock.json entries (standard tier = exact match to previous flat pricing_config; other tiers per existing bedrock.json rate cards).

Provider Models Modes added
Mistral ministral-3-3b, ministral-3-8b, ministral-3-14b, mistral-large-3-675b, devstral-2-123b, magistral-small-2509, voxtral-small-24b, voxtral-mini-3b standard / priority / flex / batch
Qwen / Moonshot / ZAI qwen3-coder-next, kimi-k2.5, kimi-k3, glm-4.7, glm-4.7-flash, glm-5 standard / priority / flex / batch (kimi-k3: no batch)
OpenAI-on-Bedrock gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-6-sol, gpt-6-luna standard
OpenAI GPT-6 Astra gpt-6-astra standard (lte-272K / gt-272K context tiers) + ultrafast

GPT-6 Astra — Ultrafast

AWS Bedrock now supports an Ultrafast service tier for GPT-6 Astra, priced at 6× standard.
Prices cross-checked against AWS docs and companion gateway PR.

Companion gateway PR (priceDimensions wiring): https://code.pan.run/airs/agent-gateway/backend/gateway-enterprise-node/-/merge_requests/2086

Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:17

Copilot AI 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.

🟡 Changes recommended

The new custom token and cache rates alter standard-request costs from the existing Mantle baseline, contradicting the promise to preserve standard pricing.

1 open issue
What changed in this PR

Adds custom pricing for 20 Bedrock Mantle models so cost calculation can account for supported service tiers and context lengths.

Changes:

  • Adds standard, priority, flex, and batch rate cards where applicable.
  • Adds context-length tiers for six OpenAI models and ultrafast pricing for GPT-6 Astra.
  • Converts several existing numeric prices to equivalent scientific notation.
File Description
pricing/​bedrock-mantle.json Adds model-specific execution modes and context-tier pricing alongside existing flat rates.

Review effort: Balanced

Comment thread pricing/bedrock-mantle.json Outdated
"pricing_config": {
"pay_as_you_go": {
"request_token": {
"price": 0.00044
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:21

Copilot AI 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.

🟡 Changes recommended

Missing batch rate cards prevent advertised discounts, while new standard tiers alter GPT-5.6 Sol and GPT-6 Sol/Luna prices despite the promised preservation of existing rates.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity GPT-6 Sol and Luna standard rates are lower than Mantle rates

pricing/​bedrock-mantle.json:1964

GPT-6 Sol's new short-context standard card lowers all four token rates by about 9.1% relative to the retained flat card—for example, input drops from 0.00022 to 0.0002—contradicting the promised preservation of standard prices. The same issue affects GPT-6 Luna at pricing/bedrock-mantle.json:2058. Preserve the existing Mantle baseline and derive the long-context rates consistently, or explicitly document intentional repricing and align the flat fallback with it.

Review effort: Balanced

}
}
}
}
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:27
@bhishmendramahala-crypto
bhishmendramahala-crypto force-pushed the feat/bedrock-mantle-full-custom-pricing branch from a275599 to f82b5c1 Compare November 6, 2026 13:29

Copilot AI 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.

🟡 Changes recommended

Unresolved findings show changed standard token rates for GPT-5.6 Sol and GPT-6 models, plus missing promised batch pricing for multiple models.

6 open issues

Review effort: Balanced

}
}
}
}
Comment thread pricing/bedrock-mantle.json Outdated
"pricing_config": {
"pay_as_you_go": {
"request_token": {
"price": 0.00044
Comment thread pricing/bedrock-mantle.json Outdated
"pricing_config": {
"pay_as_you_go": {
"request_token": {
"price": 0.0002
Comment thread pricing/bedrock-mantle.json Outdated
"pricing_config": {
"pay_as_you_go": {
"request_token": {
"price": 0.00001
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:33
@bhishmendramahala-crypto
bhishmendramahala-crypto force-pushed the feat/bedrock-mantle-full-custom-pricing branch from f82b5c1 to 83b7d0a Compare November 6, 2026 13:34

Copilot AI 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.

🔵 Needs a closer look

Missing batch entries for 13 models in pricing/bedrock-mantle.json prevent batch lookups from selecting the documented discounted rates available in pricing/bedrock.json.

6 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:37
Models previously had only flat pricing_config, causing applyCustomPricing
to ignore service_tier (priority/flex/ultrafast) and always bill at standard
rates.

Added custom_pricing with execution_modes for all bedrock-mantle models
that have a matching entry in bedrock.json with multi-tier pricing:

Mistral (8 models): standard / priority / flex
  - ministral-3-3b, ministral-3-8b, ministral-3-14b
  - mistral-large-3-675b, devstral-2-123b, magistral-small-2509
  - voxtral-small-24b, voxtral-mini-3b

Qwen/Moonshot/ZAI (6 models): standard / priority / flex
  - qwen3-coder-next, kimi-k2.5, kimi-k3 (no batch/flex), glm-4.7,
    glm-4.7-flash, glm-5

OpenAI-on-Bedrock (5 models): standard with lte-272K / gt-272K context tiers
  - gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-6-sol, gpt-6-luna

GPT-6 Astra (1 model): standard (lte-272K / gt-272K) + ultrafast
  - openai.gpt-6-astra — ultrafast = 6× standard (AWS docs confirmed)

Notes:
- batch mode intentionally excluded: batch inference is available only on
  bedrock-runtime, not bedrock-mantle (AWS docs confirmed)
- lte-272k standard tier prices match existing flat pricing_config exactly
- gt-272k prices derived proportionally from bedrock.json context-tier ratio
- All prices in plain decimal form (no scientific notation, matching repo convention)

Ref: https://docs.aws.amazon.com/bedrock/latest/userguide/scaling-throughput-best-practices.html
Companion gateway PR: https://code.pan.run/airs/agent-gateway/backend/gateway-enterprise-node/-/merge_requests/2086
@bhishmendramahala-crypto
bhishmendramahala-crypto force-pushed the feat/bedrock-mantle-full-custom-pricing branch from 83b7d0a to d81d34a Compare November 6, 2026 13:38

Copilot AI 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.

}
}
}
}
}
}
},
"custom_pricing": {
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:42

Copilot AI 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.

}
}
}
}

This branch has not been deployed

No deployments
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