Compare commits

...

5 Commits

Author SHA1 Message Date
Cline Evaluation 8cde676850 cost to 0 for x-ai provider 2025-06-09 14:57:44 -07:00
Saoud Rizwan 3a913dae07 Fixes 2025-06-09 00:47:59 -07:00
Saoud Rizwan 2d5bd98f0f Only change pricing for cline not openrouter provider 2025-06-09 00:46:53 -07:00
Saoud Rizwan d57247d1d9 Create khaki-cheetahs-tickle.md 2025-06-09 00:26:46 -07:00
Saoud Rizwan bcba389dd9 Add free grok model 2025-06-09 00:25:03 -07:00
4 changed files with 28 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Add free grok model
+11 -1
View File
@@ -74,6 +74,16 @@ export class ClineHandler implements ApiHandler {
}
if (!didOutputUsage && chunk.usage) {
// @ts-ignore-next-line
let totalCost = chunk.usage.cost || 0
const modelId = this.getModel().id
const provider = modelId.split("/")[0]
// If provider is x-ai, set totalCost to 0 (we're doing a promo)
if (provider === "x-ai") {
totalCost = 0
}
yield {
type: "usage",
cacheWriteTokens: 0,
@@ -81,7 +91,7 @@ export class ClineHandler implements ApiHandler {
inputTokens: chunk.usage.prompt_tokens || 0,
outputTokens: chunk.usage.completion_tokens || 0,
// @ts-ignore-next-line
totalCost: chunk.usage.cost || 0,
totalCost,
}
didOutputUsage = true
}
@@ -2569,10 +2569,17 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration):
selectedModelInfo: apiConfiguration?.requestyModelInfo || requestyDefaultModelInfo,
}
case "cline":
const openRouterModelId = apiConfiguration?.openRouterModelId || openRouterDefaultModelId
const openRouterModelInfo = apiConfiguration?.openRouterModelInfo || openRouterDefaultModelInfo
return {
selectedProvider: provider,
selectedModelId: apiConfiguration?.openRouterModelId || openRouterDefaultModelId,
selectedModelInfo: apiConfiguration?.openRouterModelInfo || openRouterDefaultModelInfo,
selectedModelId: openRouterModelId,
// TODO: remove this once we have a better way to handle free models on Cline
// Free grok 3 promotion
selectedModelInfo:
openRouterModelId === "x-ai/grok-3-beta"
? { ...openRouterModelInfo, inputPrice: 0, outputPrice: 0 }
: openRouterModelInfo,
}
case "openai":
return {
@@ -52,9 +52,9 @@ const featuredModels = [
label: "Trending",
},
{
id: "openai/gpt-4.1",
description: "1M context window, blazing fast",
label: "New",
id: "x-ai/grok-3-beta",
description: "Latest flagship model from xAI, free for now!",
label: "Free",
},
]