Skip to content

Commit fd3535c

Browse files
mrubenscte
andauthored
Add support for Sonic model (#7207)
Co-authored-by: cte <[email protected]>
1 parent 87c42c1 commit fd3535c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+739
-66
lines changed

packages/types/src/provider-settings.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const providerNames = [
4747
"zai",
4848
"fireworks",
4949
"io-intelligence",
50+
"roo",
5051
] as const
5152

5253
export const providerNamesSchema = z.enum(providerNames)
@@ -288,6 +289,10 @@ const ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
288289
ioIntelligenceApiKey: z.string().optional(),
289290
})
290291

292+
const rooSchema = apiModelIdProviderModelSchema.extend({
293+
// No additional fields needed - uses cloud authentication
294+
})
295+
291296
const defaultSchema = z.object({
292297
apiProvider: z.undefined(),
293298
})
@@ -324,6 +329,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
324329
zaiSchema.merge(z.object({ apiProvider: z.literal("zai") })),
325330
fireworksSchema.merge(z.object({ apiProvider: z.literal("fireworks") })),
326331
ioIntelligenceSchema.merge(z.object({ apiProvider: z.literal("io-intelligence") })),
332+
rooSchema.merge(z.object({ apiProvider: z.literal("roo") })),
327333
defaultSchema,
328334
])
329335

@@ -360,6 +366,7 @@ export const providerSettingsSchema = z.object({
360366
...zaiSchema.shape,
361367
...fireworksSchema.shape,
362368
...ioIntelligenceSchema.shape,
369+
...rooSchema.shape,
363370
...codebaseIndexProviderSchema.shape,
364371
})
365372

packages/types/src/providers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ export * from "./xai.js"
2525
export * from "./doubao.js"
2626
export * from "./zai.js"
2727
export * from "./fireworks.js"
28+
export * from "./roo.js"

packages/types/src/providers/roo.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { ModelInfo } from "../model.js"
2+
3+
// Roo provider with single model
4+
export type RooModelId = "roo/sonic"
5+
6+
export const rooDefaultModelId: RooModelId = "roo/sonic"
7+
8+
export const rooModels = {
9+
"roo/sonic": {
10+
maxTokens: 8192,
11+
contextWindow: 262_144,
12+
supportsImages: false,
13+
supportsPromptCache: false,
14+
inputPrice: 0,
15+
outputPrice: 0,
16+
description:
17+
"Stealth coding model with 262K context window, accessible for free through Roo Code Cloud for a limited time. (Note: prompts and completions are logged by the model creator and used to improve the model.)",
18+
},
19+
} as const satisfies Record<string, ModelInfo>

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
DoubaoHandler,
3636
ZAiHandler,
3737
FireworksHandler,
38+
RooHandler,
3839
} from "./providers"
3940
import { NativeOllamaHandler } from "./providers/native-ollama"
4041

@@ -140,6 +141,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
140141
return new FireworksHandler(options)
141142
case "io-intelligence":
142143
return new IOIntelligenceHandler(options)
144+
case "roo":
145+
return new RooHandler(options)
143146
default:
144147
apiProvider satisfies "gemini-cli" | undefined
145148
return new AnthropicHandler(options)

0 commit comments

Comments
 (0)