Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

kimi: expose the model as kimi-k2.7 (not the kimi-for-coding alias)

Rach Pradhan58df503c0ae8
diff --git a/src/main.zig b/src/main.zig
index f0d80227..abc1f8e8 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -152,7 +152,7 @@ const price_table = [_]ModelPrice{
.{ .name = "minimax-m3", .in = 0.3, .out = 1.2, .cache = 0.06 },
.{ .name = "mimo-v2.5-pro", .in = 0.435, .out = 0.87, .cache = 0.0036 },
.{ .name = "mimo-v2.5", .in = 0.14, .out = 0.28, .cache = 0.0028 },
- .{ .name = "kimi-for-coding", .in = 0.95, .out = 4, .cache = 0.1 },
+ .{ .name = "kimi-k2.7", .in = 0.95, .out = 4, .cache = 0.1 },
.{ .name = "kimi-k2.6", .in = 0.95, .out = 4, .cache = 0.1 },
.{ .name = "kimi-k2-thinking", .in = 0.6, .out = 2.5, .cache = 0.06 },
.{ .name = "kimi-k2.5", .in = 0.6, .out = 3, .cache = 0.06 },
@@ -259,7 +259,7 @@ const provider_specs = [_]ProviderSpec{
.{ .id = "minimax", .kind = .anthropic, .auth = .bearer, .url = "https://api.minimax.io/anthropic/v1/messages", .env_key = "MINIMAX_API_KEY", .default_model = "MiniMax-M3" },
.{ .id = "xiaomi", .kind = .openai, .auth = .bearer, .url = "https://api.xiaomimimo.com/v1/chat/completions", .env_key = "XIAOMI_API_KEY", .default_model = "mimo-v2.5-pro" },
// OpenAI-format direct providers (matched to graff's provider.json).
- .{ .id = "kimi", .kind = .openai, .auth = .bearer, .url = "https://api.kimi.com/coding/v1/chat/completions", .env_key = "KIMI_API_KEY", .default_model = "kimi-for-coding" },
+ .{ .id = "kimi", .kind = .openai, .auth = .bearer, .url = "https://api.kimi.com/coding/v1/chat/completions", .env_key = "KIMI_API_KEY", .default_model = "kimi-k2.7" },
.{ .id = "xai", .kind = .openai, .auth = .bearer, .url = "https://api.x.ai/v1/chat/completions", .env_key = "XAI_API_KEY", .default_model = "grok-4.3" },
.{ .id = "zai", .kind = .openai, .auth = .bearer, .url = "https://api.z.ai/api/paas/v4/chat/completions", .env_key = "ZAI_API_KEY", .default_model = "glm-5" },
// codex: ChatGPT login via the Responses API. Its "key" isn't an env var
@@ -320,10 +320,10 @@ const model_table = [_]ModelInfo{
.{ .provider = "codegraff", .name = "grok-build", .context = 256_000 },
.{ .provider = "codegraff", .name = "mimo-v2.5", .context = 128_000 },
.{ .provider = "codegraff", .name = "mimo-v2.5-pro", .context = 128_000 },
- // kimi: the Kimi for Coding plan endpoint serves a single alias model
- // (`kimi-for-coding`, which tracks their latest coding model) — not the
- // versioned ids; confirmed via GET /coding/v1/models 2026-06-16.
- .{ .provider = "kimi", .name = "kimi-for-coding", .context = 262_144 },
+ // kimi: the Kimi for Coding plan endpoint accepts versioned ids (and the
+ // `kimi-for-coding` alias), all routed to the latest coding model. We expose
+ // `kimi-k2.7` — its current release. Verified via /coding/v1 2026-06-16.
+ .{ .provider = "kimi", .name = "kimi-k2.7", .context = 262_144 },
.{ .provider = "xai", .name = "grok-4.3", .context = 1_000_000 },
.{ .provider = "xai", .name = "grok-build", .context = 256_000 },
.{ .provider = "zai", .name = "glm-5", .context = 204_800 },
@@ -10946,7 +10946,7 @@ test "imageMediaType from extension" {
}
test "contextFor known model and default fallback" {
- try std.testing.expectEqual(@as(u64, 262_144), contextFor("kimi", "kimi-for-coding"));
+ try std.testing.expectEqual(@as(u64, 262_144), contextFor("kimi", "kimi-k2.7"));
try std.testing.expectEqual(@as(u64, default_context), contextFor("nope", "unknown-xyz"));
}