Skip to content

feat(kimi): register k3-256k in the picker and the price catalog - #5447

Open
yuanyuanlove wants to merge 2 commits into
lidge-jun:devfrom
yuanyuanlove:feature-20260921-kimi-k3-256k
Open

yuanyuanlove wants to merge 2 commits into
lidge-jun:devfrom
yuanyuanlove:feature-20260921-kimi-k3-256k

Conversation

@yuanyuanlove

@yuanyuanlove yuanyuanlove commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

问题

Kimi 订阅端 /coding/v1/models 现在返回 k3-256k(与 kimi-for-coding[-highspeed]k3 并列),但 opencodex 的 picker 和成本追踪目录都只有 k3k3[1m]——用户选 k3-256k 后 usage 显示"无法估算"。

证据(2026-09-21 实测,非文档转述)

  • k3-256k 是服务端真实存在的 ID:POST /coding/v1/chat/completions 200。
  • 与 bare k3 是同一模型:同样长输入两边 prompt 都计 988 token(服务端脚手架一致),自我认知回答一致;K3 官方文档的计费表按 k3 一档计价。
  • k3[1m] 是 opencodex 本地别名(wire 上 strip 成 k3),而 k3-256k 是服务端原生 ID,不能靠 bracket-strip 合并。

改动

  • model-seeds.tsKIMI_CODING_K3_MODELSk3-256k,picker / 上下文窗口(262_144)/ 推理档位 / 锁定参数列表自动派生。
  • expected-prices.ts:kimi / kimi-code 各加 k3-256k 价格记录,同 KIMI_K3 档(input 3 / output 15 / cacheRead 0.3),source 注明 verified-derived 及实测依据。
  • parity 测试和 overlay membership 计数(126 → 128)同步更新。

验证

  • bun x tsc --noEmit 干净。
  • bun test tests/providers/provider-registry-parity.test.ts tests/codex-integration/codex-catalog.test.ts tests/usage/usage-cost.test.ts tests/providers/model-rename-migration.test.ts:539 pass / 0 fail。

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added support for the Kimi Coding K3 model’s 256K context variant, k3-256k.
    • Added pricing information for the new model variant across supported Kimi providers.
    • The new variant preserves the existing K3 model’s capabilities and context handling.
  • Tests

    • Updated model compatibility and pricing coverage to include the additional K3 variant and its provider-specific pricing entries.

Live verification 260921: k3-256k is the same K3 served under the
explicit ceiling id - the same 988-token scaffold and identity answer as
bare k3 on the same input. The subscription endpoint lists it alongside
kimi-for-coding[-highspeed] and k3, but the opencodex picker and the
expected-prices overlay only knew k3 and k3[1m], so usage logged under
k3-256k showed as unestimable.

- KIMI_CODING_K3_MODELS gains k3-256k, so the picker, context windows
  (262_144, the advertised ceiling), reasoning ladder and locked-parameter
  lists all derive it automatically.
- expected-prices gains kimi/kimi-code entries at the same KIMI_K3 rate
  (input 3 / output 15 / cacheRead 0.3), sourced as verified-derived with
  the live probe note.
- Parity and overlay-membership tests updated for the new id.

Verified: provider-registry-parity + codex-catalog + usage-cost +
model-rename-migration 539 pass, tsc clean.
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added enhancement New feature or request review-ready labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers notified: @lidge-jun @Ingwannu

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 779c4864-f60f-41ff-9785-8a254481bace

📥 Commits

Reviewing files that changed from the base of the PR and between 086a0f5 and c0484f4.

📒 Files selected for processing (1)
  • tests/usage/usage-cost.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The Kimi Coding registry now includes k3-256k. Both Kimi providers have matching expected-price overlays. Provider parity and overlay membership tests cover the added entries.

Changes

K3 256K Alias Support

Layer / File(s) Summary
Register the K3 256K alias
src/providers/registry/model-seeds.ts, tests/providers/provider-registry-parity.test.ts
KIMI_CODING_K3_MODELS now includes k3-256k with a 262,144-token context window. The parity test includes the alias.
Add pricing overlays
src/usage/expected-prices.ts, tests/usage/usage-cost.test.ts
The kimi and kimi-code providers receive verified-derived k3-256k overlays using K3 pricing. The membership test expects 128 overlays and checks both new keys.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary changes: registering the k3-256k Kimi model in the picker and adding it to the price catalog. It is specific, relevant, and suitable for pull re…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@github-actions
github-actions Bot marked this pull request as draft September 21, 2026 10:09
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 18 / 80

이 PR은 Kimi 구독 서버가 쓰는 모델 이름 k3-256k를, 고르는 목록과 비용표에 넣습니다.

지금까지 그 목록과 비용표에는 k3k3[1m]만 있었습니다. 사용자가 k3-256k를 고르면 사용량 화면이 가격을 못 정해서 "얼마인지 모르겠다"가 나왔습니다. 작성자는 2026-09-21에 직접 호출해 봤다고 본문에 적었습니다. k3-256k는 서버에 실제로 있고, 같은 글을 넣으면 k3와 같이 988토큰으로 세며, 답도 같았습니다. 공식 가격표도 k3 한 칸입니다.

씨앗 목록 KIMI_CODING_K3_MODELSk3-256k를 넣으면, 고르는 목록과 생각 단계와 잠긴 설정이 같이 따라갑니다. 창 크기는 262144입니다. 100만 토큰은 k3[1m]kimi-for-coding만 받고, k3-256k는 그 조건에 안 들어갑니다. 서버로 보낼 때 이름은 그대로 갑니다. 떼는 것은 끝의 대괄호 [1m]뿐이고, -256k는 안 뗍니다. 가격은 kimikimi-code 둘 다 k3와 같습니다. 입력 3, 출력 15, 캐시 읽기 0.3입니다.

라인 tests/usage/usage-cost.test.ts:381 - 가격표 테스트는 줄 수를 126에서 128로만 올렸습니다. 꼭 있어야 하는 이름에는 kimi/k3kimi/k3[1m]는 있고, 새로 넣은 kimi/k3-256kkimi-code/k3-256k는 없습니다. 새 두 줄을 지우고 엉뚱한 두 줄을 넣어도, 줄 수가 128이면 이 테스트는 통과합니다.

메인테이너의 판단이 필요한 지점

고르는 목록에 k3k3-256k가 같이 나옵니다. 둘은 같은 K3이고 창도 256K입니다. 그래도 서버가 부르는 이름이 다르고, 비용은 그 이름을 그대로 찾습니다. 한 줄로 합치면 k3-256k 사용량이 다시 가격을 못 정합니다.

같은 실측 메모에는 kimi-for-coding-highspeed도 서버 목록에 있다고 적혀 있습니다. 그 이름은 이번 PR이 넣지 않습니다. 예전부터 빠져 있던 이름이라, 이번에 같이 넣을지는 따로 보면 됩니다.

너의 추천

그대로 병합해도 됩니다. 베이스는 dev이고, types.ts/config.ts 분할과 겹치지 않아서 닫을 중복 PR은 아닙니다. 병합 전에 가격 테스트의 이름 목록에 kimi/k3-256kkimi-code/k3-256k만 넣으면, 나중에 그 두 줄이 빠져도 테스트가 잡습니다.

이 댓글은 grok-bot이 작성했습니다

Per maintainer review on lidge-jun#5447: the overlay test only bumped the row
count 126->128, so dropping the new k3-256k rows and adding any other
two rows would still pass. Name kimi/k3-256k and kimi-code/k3-256k in
the mandatory list so the test fails if either row disappears.
@yuanyuanlove
yuanyuanlove marked this pull request as ready for review September 21, 2026 10:23
@github-actions
github-actions Bot marked this pull request as draft September 21, 2026 10:23
@yuanyuanlove
yuanyuanlove marked this pull request as ready for review September 21, 2026 10:25
@github-actions
github-actions Bot marked this pull request as draft September 21, 2026 10:25
@yuanyuanlove
yuanyuanlove marked this pull request as ready for review September 21, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants