Skip to content

feat: add Kunavo provider - #448

Open
cooldk wants to merge 2 commits into
charmbracelet:mainfrom
cooldk:add-kunavo-provider
Open

feat: add Kunavo provider#448
cooldk wants to merge 2 commits into
charmbracelet:mainfrom
cooldk:add-kunavo-provider

Conversation

@cooldk

@cooldk cooldk commented Jul 17, 2026

Copy link
Copy Markdown

Adds Kunavo — a unified AI gateway to Claude, Gemini and GPT models behind one OpenAI-compatible API with transparent per-token pricing 30–70% under providers' list prices.

Config mirrors aihubmix.json: openai-compat, $KUNAVO_API_KEY, https://api.kunavo.com/v1, 10 models with per-token costs, context windows and conservative default_max_tokens.

Compatibility verified against the live endpoint today: streaming ✓, tool calling ✓, stream_options.include_usage ✓, GET /v1/models lists all ids ✓ (tested on Gemini + Claude models). Machine-readable catalog: https://kunavo.com/llms.txt

@cooldk
cooldk requested a review from andreynering as a code owner July 17, 2026 19:01
The original commit added configs/kunavo.json but never wired it up, so the
provider was dead code — no //go:embed, no registry entry, no loader func,
meaning it could never appear in Crush. Adds all three, following the existing
alphabetical placement.

Config refreshed against the live catalog:
- 10 -> 15 models (adds claude-opus-5, claude-opus-5-fast, gemini-3-6-flash,
  gpt-5-6-sol, gpt-5-4).
- cost_per_1m_in_cached was 0 on every Gemini/GPT model, which understated the
  bill — cached input is charged at 0.20x input there (0.10x on Anthropic).
- context_window values corrected against the models.dev lab registry;
  gpt-5-4, gpt-5-5 and gpt-5-6-sol are 1.05M, not the 400K previously listed.
- default_large_model_id moved claude-sonnet-5 -> claude-opus-5, which is both
  stronger and cheaper per token on this catalog ($2/$10 vs $2.10/$10.50).

`go build ./...` and `go test ./internal/providers/...` both pass locally.
@cooldk

cooldk commented Aug 9, 2026

Copy link
Copy Markdown
Author

Pushed 7727f13. Two things, one of which was a real defect in my original submission.

The provider was never registered. The first commit added internal/providers/configs/kunavo.json and stopped there — no //go:embed, no var kunavoConfig, no entry in providerRegistry, no loader func. The JSON was dead code and Kunavo could never have shown up in Crush even if this had merged. All three are now in, following the existing alphabetical placement. Apologies for the noise — that one was on me.

Config refreshed against the live catalog (10 → 15 models: adds claude-opus-5, claude-opus-5-fast, gemini-3-6-flash, gpt-5-6-sol, gpt-5-4). Three corrections worth calling out:

  • cost_per_1m_in_cached was 0 on every Gemini/GPT model. That understated the bill — cached input is charged at 0.20x input on those, 0.10x on the Anthropic-protocol ones.
  • context_window values were hand-entered floors and several were wrong. Corrected against the models.dev lab registry — gpt-5-4, gpt-5-5 and gpt-5-6-sol are 1.05M, not 400K.
  • default_large_model_id moved claude-sonnet-5claude-opus-5, which is both stronger and cheaper per token on this catalog ($2/$10 vs $2.10/$10.50).

go build ./... and go test ./internal/providers/... both pass locally.

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