Add FirePass provider support for Kimi K2.5 Turbo
- Add new 'firepass' provider type alongside anthropic, openai, openrouter - FirePass uses Fireworks AI's endpoint for Kimi K2.5 Turbo model - Subscription billing model ($7/week) with 256K context window - Anthropic API compatible (uses Anthropic SDK with custom baseURL) Changes: - providers.ts: Add firepass detection and base URL handling - auth.ts: Add FirePass API key management (FIREPASS_API_KEY or FIREWORKS_API_KEY) - config.ts: Add firepassApiKey and firepass auth provider - client.ts: Add firepass client creation with custom baseURL - http.ts: Add firepass auth headers - modelStrings.ts: Return Kimi K2.5 Turbo model ID for firepass - model.ts: Add Kimi display name handling and default model logic - modelOptions.ts: Simplified model picker for firepass (Kimi K2.5 Turbo only) - status.tsx: Display FirePass in status bar - login.tsx: Add FirePass option to provider selection - FirepassLoginFlow.tsx: New component for FirePass login flow Usage: 1. Run /login and select "FirePass" 2. Enter your Fireworks API key 3. Model picker shows Kimi K2.5 Turbo
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
getAnthropicApiKey,
|
||||
getApiKeyFromApiKeyHelper,
|
||||
getClaudeAIOAuthTokens,
|
||||
getFirepassApiKey,
|
||||
getOpenAIApiKey,
|
||||
getOpenRouterApiKey,
|
||||
isClaudeAISubscriber,
|
||||
@@ -17,6 +18,7 @@ import { getUserAgent } from 'src/utils/http.js'
|
||||
import { getSmallFastModel } from 'src/utils/model/model.js'
|
||||
import {
|
||||
getAPIProvider,
|
||||
getFirepassBaseUrl,
|
||||
getOpenAIBaseUrl,
|
||||
getOpenRouterBaseUrl,
|
||||
isFirstPartyAnthropicBaseUrl,
|
||||
@@ -316,6 +318,26 @@ export async function getAnthropicClient({
|
||||
return new Anthropic(clientConfig)
|
||||
}
|
||||
|
||||
if (provider === 'firepass') {
|
||||
// FirePass uses Fireworks AI's Anthropic-compatible endpoint
|
||||
// Requires an active FirePass subscription for the kimi-k2p5-turbo router
|
||||
const firepassKey = apiKey || getFirepassApiKey()
|
||||
if (!firepassKey) {
|
||||
throw new Error(
|
||||
'FirePass provider selected but no FirePass/Fireworks API key is configured. Set FIREPASS_API_KEY or FIREWORKS_API_KEY.',
|
||||
)
|
||||
}
|
||||
|
||||
const clientConfig: ConstructorParameters<typeof Anthropic>[0] = {
|
||||
apiKey: firepassKey,
|
||||
baseURL: getFirepassBaseUrl(),
|
||||
...ARGS,
|
||||
...(isDebugToStdErr() && { logger: createStderrLogger() }),
|
||||
}
|
||||
|
||||
return new Anthropic(clientConfig)
|
||||
}
|
||||
|
||||
if (provider === 'openai') {
|
||||
await refreshOpenAIAuthTokenIfNeeded()
|
||||
const openAIKey = apiKey || getOpenAIApiKey()
|
||||
|
||||
Reference in New Issue
Block a user