Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { modelInfoSchema, reasoningEffortSettingSchema, verbosityLevelsSchema, s
import { codebaseIndexProviderSchema } from "./codebase-index.js"
import {
anthropicModels,
avianModels,
basetenModels,
bedrockModels,
deepSeekModels,
Expand Down Expand Up @@ -103,6 +104,7 @@ export const providerNames = [
...customProviders,
...fauxProviders,
"anthropic",
"avian",
"bedrock",
"baseten",
"deepseek",
Expand Down Expand Up @@ -359,6 +361,10 @@ const zaiSchema = apiModelIdProviderModelSchema.extend({
zaiApiLine: zaiApiLineSchema.optional(),
})

const avianSchema = apiModelIdProviderModelSchema.extend({
avianApiKey: z.string().optional(),
})

const fireworksSchema = apiModelIdProviderModelSchema.extend({
fireworksApiKey: z.string().optional(),
})
Expand Down Expand Up @@ -387,6 +393,7 @@ const defaultSchema = z.object({

export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProvider", [
anthropicSchema.merge(z.object({ apiProvider: z.literal("anthropic") })),
avianSchema.merge(z.object({ apiProvider: z.literal("avian") })),
openRouterSchema.merge(z.object({ apiProvider: z.literal("openrouter") })),
bedrockSchema.merge(z.object({ apiProvider: z.literal("bedrock") })),
vertexSchema.merge(z.object({ apiProvider: z.literal("vertex") })),
Expand Down Expand Up @@ -420,6 +427,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
export const providerSettingsSchema = z.object({
apiProvider: providerNamesWithRetiredSchema.optional(),
...anthropicSchema.shape,
...avianSchema.shape,
...openRouterSchema.shape,
...bedrockSchema.shape,
...vertexSchema.shape,
Expand Down Expand Up @@ -497,6 +505,7 @@ export const isTypicalProvider = (key: unknown): key is TypicalProvider =>

export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
anthropic: "apiModelId",
avian: "apiModelId",
openrouter: "openRouterModelId",
bedrock: "apiModelId",
vertex: "apiModelId",
Expand Down Expand Up @@ -565,6 +574,11 @@ export const MODELS_BY_PROVIDER: Record<
label: "Anthropic",
models: Object.keys(anthropicModels),
},
avian: {
id: "avian",
label: "Avian",
models: Object.keys(avianModels),
},
bedrock: {
id: "bedrock",
label: "Amazon Bedrock",
Expand Down
49 changes: 49 additions & 0 deletions packages/types/src/providers/avian.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { ModelInfo } from "../model.js"

// https://avian.io
export type AvianModelId = "deepseek/deepseek-v3.2" | "moonshotai/kimi-k2.5" | "z-ai/glm-5" | "minimax/minimax-m2.5"

export const avianDefaultModelId: AvianModelId = "deepseek/deepseek-v3.2"

export const avianModels = {
"deepseek/deepseek-v3.2": {
maxTokens: 65536,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.26,
outputPrice: 0.38,
description:
"DeepSeek V3.2 is the latest iteration of the V3 model family with enhanced reasoning capabilities, improved code generation, and better instruction following. 164K context window with 65K max output.",
},
"moonshotai/kimi-k2.5": {
maxTokens: 8192,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.45,
outputPrice: 2.2,
description:
"Kimi K2.5 is Moonshot AI's flagship agentic model. It unifies vision and text, thinking and non-thinking modes, and single-agent and multi-agent execution into one model. 131K context window.",
},
"z-ai/glm-5": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.3,
outputPrice: 2.55,
description:
"Z.ai GLM-5 is an advanced coding and reasoning model with exceptional performance on complex programming tasks. 131K context window with 16K max output.",
},
"minimax/minimax-m2.5": {
maxTokens: 1048576,
contextWindow: 1048576,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.3,
outputPrice: 1.1,
description:
"MiniMax M2.5 is a high-performance language model with an industry-leading 1M context window, optimized for long-context understanding and generation tasks.",
},
} as const satisfies Record<string, ModelInfo>
4 changes: 4 additions & 0 deletions packages/types/src/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./anthropic.js"
export * from "./avian.js"
export * from "./baseten.js"
export * from "./bedrock.js"
export * from "./deepseek.js"
Expand Down Expand Up @@ -26,6 +27,7 @@ export * from "./zai.js"
export * from "./minimax.js"

import { anthropicDefaultModelId } from "./anthropic.js"
import { avianDefaultModelId } from "./avian.js"
import { basetenDefaultModelId } from "./baseten.js"
import { bedrockDefaultModelId } from "./bedrock.js"
import { deepSeekDefaultModelId } from "./deepseek.js"
Expand Down Expand Up @@ -101,6 +103,8 @@ export function getProviderDefaultModelId(
return vscodeLlmDefaultModelId
case "sambanova":
return sambaNovaDefaultModelId
case "avian":
return avianDefaultModelId
case "fireworks":
return fireworksDefaultModelId
case "roo":
Expand Down
3 changes: 3 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ApiStream } from "./transform/stream"

import {
AnthropicHandler,
AvianHandler,
AwsBedrockHandler,
OpenRouterHandler,
VertexHandler,
Expand Down Expand Up @@ -120,6 +121,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
switch (apiProvider) {
case "anthropic":
return new AnthropicHandler(options)
case "avian":
return new AvianHandler(options)
case "openrouter":
return new OpenRouterHandler(options)
case "bedrock":
Expand Down
Loading
Loading