Skip to content

Commit bbe0843

Browse files
committed
freebuff: Enable kimi 24/7
1 parent fbecf8e commit bbe0843

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

web/src/llm-api/__tests__/fireworks-deployment.test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,16 @@ describe('Fireworks deployment routing', () => {
184184
expect(fetchCalls).toEqual([KIMI_STANDARD_MODEL_ID])
185185
})
186186

187-
it('keeps Kimi unavailable outside hours when no deployment is mapped', async () => {
188-
const mockFetch = mock(async () => {
189-
throw new Error('should not fetch outside deployment hours')
190-
}) as unknown as typeof globalThis.fetch
187+
it('uses serverless API for Kimi outside deployment hours (Kimi is 24/7)', async () => {
188+
const fetchCalls: string[] = []
189+
190+
const mockFetch = mock(
191+
async (_url: string | URL | Request, init?: RequestInit) => {
192+
const body = JSON.parse(init?.body as string)
193+
fetchCalls.push(body.model)
194+
return new Response(JSON.stringify({ ok: true }), { status: 200 })
195+
},
196+
) as unknown as typeof globalThis.fetch
191197

192198
const response = await createFireworksRequestWithFallback({
193199
body: kimiBody as never,
@@ -202,9 +208,8 @@ describe('Fireworks deployment routing', () => {
202208
now: BEFORE_DEPLOYMENT_HOURS,
203209
})
204210

205-
expect(response.status).toBe(503)
206-
const body = await response.json()
207-
expect(body.error.code).toBe('DEPLOYMENT_OUTSIDE_HOURS')
211+
expect(response.status).toBe(200)
212+
expect(fetchCalls).toEqual([KIMI_STANDARD_MODEL_ID])
208213
})
209214

210215
it('keeps GLM unavailable outside hours when no deployment is mapped', async () => {
@@ -433,7 +438,7 @@ describe('Fireworks deployment routing', () => {
433438
expect(body.error.code).toBe('DEPLOYMENT_OUTSIDE_HOURS')
434439
})
435440

436-
it('falls back to the standard Fireworks API for Kimi lite mode outside deployment hours', async () => {
441+
it('uses the standard Fireworks API for Kimi lite mode outside deployment hours', async () => {
437442
const fetchCalls: string[] = []
438443

439444
const mockFetch = mock(

web/src/llm-api/fireworks-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const FIREWORKS_ACCOUNT_ID = 'james-65d217'
1010

1111
export const FIREWORKS_DEPLOYMENT_MAP: Record<string, string> = {
1212
// 'minimax/minimax-m2.5': 'accounts/james-65d217/deployments/lnfid5h9',
13-
// Disabled: route Kimi K2.6 through the Fireworks serverless API during
14-
// availability hours instead of the dedicated deployment.
13+
// Disabled: route Kimi K2.6 through the Fireworks serverless API (24/7)
14+
// instead of the dedicated deployment.
1515
// 'moonshotai/kimi-k2.6': 'accounts/james-65d217/deployments/mjb4i7ea',
1616
// 'minimax/minimax-m2.7': 'accounts/james-65d217/deployments/nrdudqxd',
1717
}

web/src/llm-api/fireworks.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ const FIREWORKS_MODEL_MAP: Record<string, string> = {
4040
}
4141

4242
/** Models that stay limited to freebuff deployment hours even on serverless. */
43-
const FIREWORKS_HOURS_GATED_MODELS = new Set<string>([
44-
'moonshotai/kimi-k2.6',
45-
'z-ai/glm-5.1',
46-
])
43+
const FIREWORKS_HOURS_GATED_MODELS = new Set<string>(['z-ai/glm-5.1'])
4744

4845
/** Flag to enable custom Fireworks deployments (set to false to use global API only) */
4946
const FIREWORKS_USE_CUSTOM_DEPLOYMENT = true

0 commit comments

Comments
 (0)