Skip to content

fix(config): Update model context windows and pricing for current model lineup - #452

Merged
edenreich merged 1 commit into
mainfrom
fix/model-pricing-and-context-windows
Apr 27, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/model-pricing-and-context-windows

Conversation

@edenreich

@edenreich edenreich commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Align model context-window patterns and pricing data with the actual model IDs served by the gateway today
  • Fix misleading "(free)" label that appeared for any model with no pricing entry — unknown models now render with no suffix
  • Refresh stale Claude model references in test data

Details

Context windows (config/model_context.go)

  • Drop dead patterns (claude-4, claude-3.5, claude-3, claude-2) that never actually matched real IDs like claude-opus-4-7
  • Add claude-opus-4-7 → 1M
  • Add claude-{opus,sonnet,haiku}-4 family → 200K

Pricing display (internal/services/pricing_service.go)

  • FormatModelPricing now distinguishes "no pricing entry" (returns "") from "explicit 0/0" (returns "free")
  • Previously every unknown model rendered as (free), which was misleading for paid models the CLI didn't know about

Pricing data (config/pricing.go)

  • Drop legacy Claude 3.x / 3-5 entries no longer on the API list
  • Add Claude Opus 4.7, Sonnet 4.6, Opus 4.6 (sourced from claude.com/pricing)
  • Add Gemini 2.5/2.0/3.x paid-tier prices (sourced from ai.google.dev/gemini-api/docs/pricing)
  • Add all 8 Gemma variants at $0 (Google lists Gemma as free)
  • Add 33 Ollama Cloud entries at $0 (Ollama Cloud is subscription-based, not per-token, so marginal token cost is zero)
  • Add Moonshot Kimi 2.5 ($0.60/$3.00) and Kimi 2.6 ($0.74/$4.66)

Test data refresh

  • config/agents_test.go, config/config_test.go: replace claude-4 / claude-4-5-sonnet with claude-sonnet-4-6

Models still unpriced (intentionally)

Display nothing for now — pricing schema is per-MTok, but these are billed per-image / per-second / per-song / unknown:

  • Image gen: imagen-4.0-*, gemini-*-image*, nano-banana-pro-preview
  • Video gen: veo-2.0-*, veo-3.0-*, veo-3.1-*
  • Audio: lyria-3-*, gemini-*-native-audio-*, gemini-*-tts-preview, gemini-*-live-preview
  • Aliases (target shifts): gemini-flash-latest, gemini-flash-lite-latest, gemini-pro-latest
  • Specialty / unknown: gemini-3-pro-preview, gemini-robotics-er-*, gemini-2.5-computer-use-preview-*, deep-research-*, aqa, gemini-embedding-2-preview

…el lineup

Aligns context window patterns and pricing data with the actual model IDs
served by the gateway, and fixes the misleading "(free)" label that
appeared for any model lacking a pricing entry.

- model_context.go: drop dead patterns ("claude-4", "claude-3.5",
  "claude-3", "claude-2") that never matched real IDs like
  "claude-opus-4-7"; add explicit "claude-opus-4-7" → 1M and the
  "claude-{opus,sonnet,haiku}-4" family at 200K
- pricing_service.go: distinguish "no pricing entry" (returns "")
  from "explicit 0/0" (returns "free"); previously every unknown
  model was rendered as "(free)"
- pricing.go: drop legacy claude-3.x/3-5 entries no longer on the
  API list; add Claude Opus 4.7/Sonnet 4.6/Opus 4.6 with paid prices
  from claude.com/pricing; add Gemini 2.5/2.0/3.x paid-tier prices
  from ai.google.dev/gemini-api/docs/pricing; add all 8 Gemma
  variants ($0); add 33 Ollama Cloud entries at $0 (subscription
  billing, not per-token); add Moonshot Kimi 2.5/2.6
- agents_test.go, config_test.go: refresh hardcoded model names
  ("claude-4", "claude-4-5-sonnet" → "claude-sonnet-4-6")
@edenreich
edenreich merged commit 655f9f8 into main Apr 27, 2026
@edenreich
edenreich deleted the fix/model-pricing-and-context-windows branch April 27, 2026 11:23
inference-gateway-releaser Bot pushed a commit that referenced this pull request Apr 27, 2026
## [0.104.1](v0.104.0...v0.104.1) (2026-04-27)

### 🐛 Bug Fixes

* **ui:** Restore typing while agent is busy ([#455](#455)) ([92840d6](92840d6)), closes [#410](#410)
* **services:** Trigger auto-compact from gateway-reported tokens ([#454](#454)) ([1fc19dd](1fc19dd))
* **config:** Update model context windows and pricing for current model lineup ([#452](#452)) ([655f9f8](655f9f8))

### ♻️ Code Refactoring

* **config:** Centralize config loading and remove service indirection ([#443](#443)) ([babf173](babf173))
* **config:** Centralize sub-config definitions and consolidate prompts ([#448](#448)) ([9979ac7](9979ac7))
* Extract keybindings configuration to separate file ([#438](#438)) ([6d04195](6d04195))
* **config:** Generate viper defaults via reflection over DefaultConfig() ([#436](#436)) ([85c6e0a](85c6e0a))
* **config:** Make tool prompts configurable via prompts.yaml ([#450](#450)) ([9fc1bb5](9fc1bb5)), closes [#446](#446)
* Move channels to separate channels.yaml config ([#444](#444)) ([aa43e0e](aa43e0e)), closes [#441](#441)
* Move computer_use to a separate config ([#447](#447)) ([a762c64](a762c64)), closes [#444](#444)
* Move prompts to separate prompts.yaml config ([#442](#442)) ([45e4fb6](45e4fb6))
* **config:** Unify sub-configs behind CollectionConfig + utils.{Load,Save}YAML ([#445](#445)) ([aab481c](aab481c))

### 📚 Documentation

* Add directory-structure reference ([#451](#451)) ([95d26f8](95d26f8))

### 👷 CI/CD

* Reduce runs of nix ([acac364](acac364))

### 🧹 Maintenance

* **deps:** Bump modernc.org/sqlite from 1.49.1 to 1.50.0 ([#449](#449)) ([06a535d](06a535d))
* **nix:** Update package to v0.104.0 ([#432](#432)) ([5564697](5564697))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.104.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Apr 27, 2026
edenreich added a commit that referenced this pull request Oct 2, 2026
…s) (#1476)

Resolves #1474

## Summary

Bump github.com/inference-gateway/adk from v0.29.0 to v0.30.0 so the CLI
speaks the A2A v1.0.1 wire types that freshly generated agents (adl-cli
#452 scaffolds) already send. The three wire-level breakages named in
the issue are fixed: the renamed canceled task state, the flattened
parts, and the SupportedInterfaces-based agent card. On the open
question, the CLI stays tolerant of pre-v1.0.1 task-state spellings:
NormalizeTaskState accepts both on read, while everything the CLI sends
uses the new shape. Nested data parts and file parts from v0.29-era
agents are not read, so their structured errors and file-part artifact
URLs are dropped. Text parts and the artifact metadata url still work.

## Changes

- Bump github.com/inference-gateway/adk to v0.30.0 (go.mod, go.sum)
- adk.TaskStateCancelled -> adk.TaskStateCanceled at every comparison
and construction site: domain/tasks.go state list, key map and display
map, background_tasks.go terminal guard, job.go retention matcher,
submit_task.go cancel case and the local cancel result
- Wire tolerance on read: NormalizeTaskState maps TASK_STATE_CANCELED
(v1.0.1), TASK_STATE_CANCELLED and the bare cancelled/canceled forms
onto adk.TaskStateCanceled, so a v0.29-era agent is still recognized as
terminal instead of being polled forever
- Client param renames from the v0.30.0 interface: TaskQueryParams ->
GetTaskRequest, TaskIdParams -> CancelTaskRequest, MessageSendParams ->
SendMessageRequest with SendMessageConfiguration. The removed Blocking
flag is dropped since ReturnImmediately=false (the default of the empty
field) keeps the same wait-for-terminal behavior
- Flattened v1.0.1 parts: data parts are read via Part.DataMap()
(arbitrary JSON value, failure.go) instead of the deleted nested
DataPart, file parts via Part.URL instead of Part.File.FileWithURI in
the artifact download URL resolution
- Agent card: the A2A_QueryAgent result now surfaces the preferred
endpoint read from card.SupportedInterfaces[0].URL (new
a2ainfra.PreferredEndpointURL, falling back to the configured base URL),
with a new PreferredEndpointURL helper in the ADK agent-card wrapper
- Task.ContextID became optional: switch to the adk Task.GetContextID()
accessor where the CLI read it as a string (submit_task.go,
task_management_view.go) and pass pointers where tasks are rebuilt
(job.go, tests)
- Table test for PreferredEndpointURL covering no card, no interfaces,
first interface wins and an empty URL skipped
- Regenerate tests/mocks/adk/fake_a2aclient.go against the new A2AClient
interface via task mocks:generate
- Add a wire-shape regression test that decodes a v1.0.1 task JSON
(flattened data part with the error key and a file part carrying url)
through the same decode path the tools use, asserting failure reason and
artifact download URL survive

## Downstream

- Docs: filed a [DOCS] ticket in inference-gateway/docs for user-facing
A2A v1.0.1 compatibility notes (task state spelling surfaced in results,
agent card shape). Affected repos: inference-gateway/docs only, the CLI
is a leaf consumer of the ADK.

---------

Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
Co-authored-by: Eden Reich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant