Skip to content

Commit 8d1ecd6

Browse files
committed
feat: add ModelHarbor provider integration and update related components
1 parent c4dab9e commit 8d1ecd6

File tree

21 files changed

+884
-9
lines changed

21 files changed

+884
-9
lines changed

packages/types/src/global-settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const globalSettingsSchema = z.object({
4848
allowedMaxRequests: z.number().nullish(),
4949
autoCondenseContext: z.boolean().optional(),
5050
autoCondenseContextPercent: z.number().optional(),
51-
maxConcurrentFileReads: z.number().optional(),
51+
maxConcurrentFileReads: z.number().optional(),
5252

5353
browserToolEnabled: z.boolean().optional(),
5454
browserViewportSize: z.string().optional(),
@@ -221,6 +221,7 @@ export type SecretState = Pick<
221221
| "groqApiKey"
222222
| "chutesApiKey"
223223
| "litellmApiKey"
224+
| "modelharborApiKey"
224225
| "codeIndexOpenAiKey"
225226
| "codeIndexQdrantApiKey"
226227
>
@@ -243,6 +244,7 @@ export const SECRET_STATE_KEYS = keysOf<SecretState>()([
243244
"groqApiKey",
244245
"chutesApiKey",
245246
"litellmApiKey",
247+
"modelharborApiKey",
246248
"codeIndexOpenAiKey",
247249
"codeIndexQdrantApiKey",
248250
])

packages/types/src/provider-settings.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const providerNames = [
3030
"groq",
3131
"chutes",
3232
"litellm",
33+
"modelharbor",
3334
] as const
3435

3536
export const providerNamesSchema = z.enum(providerNames)
@@ -203,6 +204,11 @@ const litellmSchema = baseProviderSettingsSchema.extend({
203204
litellmModelId: z.string().optional(),
204205
})
205206

207+
const modelharborSchema = baseProviderSettingsSchema.extend({
208+
modelharborApiKey: z.string().optional(),
209+
modelharborModelId: z.string().optional(),
210+
})
211+
206212
const defaultSchema = z.object({
207213
apiProvider: z.undefined(),
208214
})
@@ -229,6 +235,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
229235
groqSchema.merge(z.object({ apiProvider: z.literal("groq") })),
230236
chutesSchema.merge(z.object({ apiProvider: z.literal("chutes") })),
231237
litellmSchema.merge(z.object({ apiProvider: z.literal("litellm") })),
238+
modelharborSchema.merge(z.object({ apiProvider: z.literal("modelharbor") })),
232239
defaultSchema,
233240
])
234241

@@ -255,6 +262,7 @@ export const providerSettingsSchema = z.object({
255262
...groqSchema.shape,
256263
...chutesSchema.shape,
257264
...litellmSchema.shape,
265+
...modelharborSchema.shape,
258266
...codebaseIndexProviderSchema.shape,
259267
})
260268

@@ -359,4 +367,7 @@ export const PROVIDER_SETTINGS_KEYS = keysOf<ProviderSettings>()([
359367
"litellmBaseUrl",
360368
"litellmApiKey",
361369
"litellmModelId",
370+
// ModelHarbor
371+
"modelharborApiKey",
372+
"modelharborModelId",
362373
])

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 "./groq.js"
88
export * from "./lite-llm.js"
99
export * from "./lm-studio.js"
1010
export * from "./mistral.js"
11+
export * from "./modelharbor.js"
1112
export * from "./openai.js"
1213
export * from "./openrouter.js"
1314
export * from "./requesty.js"

0 commit comments

Comments
 (0)