Skip to content

Commit f159190

Browse files
author
BuildTools
committed
1 parent ab9a485 commit f159190

File tree

33 files changed

+1407
-1
lines changed

33 files changed

+1407
-1
lines changed

packages/types/src/provider-settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
429429
lmStudioSchema.merge(z.object({ apiProvider: z.literal("lmstudio") })),
430430
geminiSchema.merge(z.object({ apiProvider: z.literal("gemini") })),
431431
geminiCliSchema.merge(z.object({ apiProvider: z.literal("gemini-cli") })),
432+
geminiCliSchema.merge(z.object({ apiProvider: z.literal("gemini-cli") })),
432433
openAiNativeSchema.merge(z.object({ apiProvider: z.literal("openai-native") })),
433434
mistralSchema.merge(z.object({ apiProvider: z.literal("mistral") })),
434435
deepSeekSchema.merge(z.object({ apiProvider: z.literal("deepseek") })),
@@ -470,6 +471,7 @@ export const providerSettingsSchema = z.object({
470471
...lmStudioSchema.shape,
471472
...geminiSchema.shape,
472473
...geminiCliSchema.shape,
474+
...geminiCliSchema.shape,
473475
...openAiNativeSchema.shape,
474476
...mistralSchema.shape,
475477
...deepSeekSchema.shape,
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import type { ModelInfo } from "../model.js"
2+
3+
// Gemini CLI models with free tier pricing (all $0)
4+
export type GeminiCliModelId = keyof typeof geminiCliModels
5+
6+
export const geminiCliDefaultModelId: GeminiCliModelId = "gemini-2.0-flash-001"
7+
8+
export const geminiCliModels = {
9+
"gemini-2.0-flash-001": {
10+
maxTokens: 8192,
11+
contextWindow: 1_048_576,
12+
supportsImages: true,
13+
supportsPromptCache: false,
14+
inputPrice: 0,
15+
outputPrice: 0,
16+
},
17+
"gemini-2.0-flash-thinking-exp-01-21": {
18+
maxTokens: 65_536,
19+
contextWindow: 1_048_576,
20+
supportsImages: true,
21+
supportsPromptCache: false,
22+
inputPrice: 0,
23+
outputPrice: 0,
24+
},
25+
"gemini-2.0-flash-thinking-exp-1219": {
26+
maxTokens: 8192,
27+
contextWindow: 32_767,
28+
supportsImages: true,
29+
supportsPromptCache: false,
30+
inputPrice: 0,
31+
outputPrice: 0,
32+
},
33+
"gemini-2.0-flash-exp": {
34+
maxTokens: 8192,
35+
contextWindow: 1_048_576,
36+
supportsImages: true,
37+
supportsPromptCache: false,
38+
inputPrice: 0,
39+
outputPrice: 0,
40+
},
41+
"gemini-1.5-flash-002": {
42+
maxTokens: 8192,
43+
contextWindow: 1_048_576,
44+
supportsImages: true,
45+
supportsPromptCache: false,
46+
inputPrice: 0,
47+
outputPrice: 0,
48+
},
49+
"gemini-1.5-flash-exp-0827": {
50+
maxTokens: 8192,
51+
contextWindow: 1_048_576,
52+
supportsImages: true,
53+
supportsPromptCache: false,
54+
inputPrice: 0,
55+
outputPrice: 0,
56+
},
57+
"gemini-1.5-flash-8b-exp-0827": {
58+
maxTokens: 8192,
59+
contextWindow: 1_048_576,
60+
supportsImages: true,
61+
supportsPromptCache: false,
62+
inputPrice: 0,
63+
outputPrice: 0,
64+
},
65+
"gemini-1.5-pro-002": {
66+
maxTokens: 8192,
67+
contextWindow: 2_097_152,
68+
supportsImages: true,
69+
supportsPromptCache: false,
70+
inputPrice: 0,
71+
outputPrice: 0,
72+
},
73+
"gemini-1.5-pro-exp-0827": {
74+
maxTokens: 8192,
75+
contextWindow: 2_097_152,
76+
supportsImages: true,
77+
supportsPromptCache: false,
78+
inputPrice: 0,
79+
outputPrice: 0,
80+
},
81+
"gemini-exp-1206": {
82+
maxTokens: 8192,
83+
contextWindow: 2_097_152,
84+
supportsImages: true,
85+
supportsPromptCache: false,
86+
inputPrice: 0,
87+
outputPrice: 0,
88+
},
89+
"gemini-2.5-flash": {
90+
maxTokens: 64_000,
91+
contextWindow: 1_048_576,
92+
supportsImages: true,
93+
supportsPromptCache: false,
94+
inputPrice: 0,
95+
outputPrice: 0,
96+
maxThinkingTokens: 24_576,
97+
supportsReasoningBudget: true,
98+
},
99+
"gemini-2.5-pro": {
100+
maxTokens: 64_000,
101+
contextWindow: 1_048_576,
102+
supportsImages: true,
103+
supportsPromptCache: false,
104+
inputPrice: 0,
105+
outputPrice: 0,
106+
maxThinkingTokens: 32_768,
107+
supportsReasoningBudget: true,
108+
requiredReasoningBudget: true,
109+
},
110+
} as const satisfies Record<string, ModelInfo>

packages/types/src/providers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from "./doubao.js"
88
export * from "./featherless.js"
99
export * from "./fireworks.js"
1010
export * from "./gemini.js"
11+
export * from "./gemini-cli.js"
1112
export * from "./glama.js"
1213
export * from "./groq.js"
1314
export * from "./huggingface.js"

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
OpenAiHandler,
1616
LmStudioHandler,
1717
GeminiHandler,
18+
GeminiCliHandler,
1819
OpenAiNativeHandler,
1920
DeepSeekHandler,
2021
MoonshotHandler,
@@ -113,6 +114,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
113114
return new LmStudioHandler(options)
114115
case "gemini":
115116
return new GeminiHandler(options)
117+
case "gemini-cli":
118+
return new GeminiCliHandler(options)
116119
case "openai-native":
117120
return new OpenAiNativeHandler(options)
118121
case "deepseek":

0 commit comments

Comments
 (0)