Skip to content

Commit 9d94c33

Browse files
committed
Update default model
1 parent 1389e62 commit 9d94c33

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

packages/types/src/providers/huggingface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* HuggingFace provider constants
33
*/
44

5+
export type HuggingFaceModelId = string
6+
export const huggingFaceDefaultModelId = "moonshotai/Kimi-K2-Instruct-0905"
7+
58
// Default values for HuggingFace models
69
export const HUGGINGFACE_DEFAULT_MAX_TOKENS = 2048
710
export const HUGGINGFACE_MAX_TOKENS_FALLBACK = 8192

src/api/providers/huggingface.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { DEFAULT_HEADERS } from "./constants"
99
import { BaseProvider } from "./base-provider"
1010
import { getHuggingFaceModels, getCachedHuggingFaceModels } from "./fetchers/huggingface"
1111
import { handleOpenAIError } from "./utils/openai-error-handler"
12+
import { huggingFaceDefaultModelId } from "@roo-code/types"
1213

1314
export class HuggingFaceHandler extends BaseProvider implements SingleCompletionHandler {
1415
private client: OpenAI
@@ -50,7 +51,7 @@ export class HuggingFaceHandler extends BaseProvider implements SingleCompletion
5051
messages: Anthropic.Messages.MessageParam[],
5152
metadata?: ApiHandlerCreateMessageMetadata,
5253
): ApiStream {
53-
const modelId = this.options.huggingFaceModelId || "meta-llama/Llama-3.3-70B-Instruct"
54+
const modelId = this.options.huggingFaceModelId || huggingFaceDefaultModelId
5455
const temperature = this.options.modelTemperature ?? 0.7
5556

5657
const params: OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming = {
@@ -94,7 +95,7 @@ export class HuggingFaceHandler extends BaseProvider implements SingleCompletion
9495
}
9596

9697
async completePrompt(prompt: string): Promise<string> {
97-
const modelId = this.options.huggingFaceModelId || "meta-llama/Llama-3.3-70B-Instruct"
98+
const modelId = this.options.huggingFaceModelId || huggingFaceDefaultModelId
9899

99100
try {
100101
const response = await this.client.chat.completions.create({
@@ -109,7 +110,7 @@ export class HuggingFaceHandler extends BaseProvider implements SingleCompletion
109110
}
110111

111112
override getModel() {
112-
const modelId = this.options.huggingFaceModelId || "meta-llama/Llama-3.3-70B-Instruct"
113+
const modelId = this.options.huggingFaceModelId || huggingFaceDefaultModelId
113114

114115
// Try to get model info from cache
115116
const modelInfo = this.modelCache?.[modelId]

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import { WebviewMessage } from "../../shared/WebviewMessage"
5656
import { EMBEDDING_MODEL_PROFILES } from "../../shared/embeddingModels"
5757
import { ProfileValidator } from "../../shared/ProfileValidator"
5858
import { HUGGING_FACE_OAUTH_CLIENT_ID } from "../../shared/oauth-constants"
59+
import { huggingFaceDefaultModelId } from "@roo-code/types"
5960

6061
import { Terminal } from "../../integrations/terminal/Terminal"
6162
import { downloadTask } from "../../integrations/misc/export-markdown"
@@ -1474,7 +1475,7 @@ export class ClineProvider
14741475
...apiConfiguration,
14751476
apiProvider: "huggingface",
14761477
huggingFaceApiKey: accessToken,
1477-
huggingFaceModelId: apiConfiguration?.huggingFaceModelId || "meta-llama/Llama-3.3-70B-Instruct",
1478+
huggingFaceModelId: apiConfiguration?.huggingFaceModelId || huggingFaceDefaultModelId,
14781479
huggingFaceInferenceProvider: apiConfiguration?.huggingFaceInferenceProvider || "auto",
14791480
}
14801481

webview-ui/src/components/ui/hooks/useSelectedModel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import {
5757
vercelAiGatewayDefaultModelId,
5858
BEDROCK_CLAUDE_SONNET_4_MODEL_ID,
5959
deepInfraDefaultModelId,
60+
huggingFaceDefaultModelId,
6061
} from "@roo-code/types"
6162

6263
import type { ModelRecord, RouterModels } from "@roo/api"
@@ -174,7 +175,7 @@ function getSelectedModel({
174175
return { id, info }
175176
}
176177
case "huggingface": {
177-
const id = apiConfiguration.huggingFaceModelId ?? "meta-llama/Llama-3.3-70B-Instruct"
178+
const id = apiConfiguration.huggingFaceModelId ?? huggingFaceDefaultModelId
178179
const info = {
179180
maxTokens: 8192,
180181
contextWindow: 131072,

0 commit comments

Comments
 (0)