Skip to content

Commit 33152ae

Browse files
committed
feat: add browser-use support for Qwen3-Coder-480B models on Cerebras
- Enable supportsComputerUse for qwen-3-coder-480b-free and qwen-3-coder-480b models - Add comprehensive tests to verify computer use support - Fixes #6693
1 parent 1d714c8 commit 33152ae

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

packages/types/src/providers/cerebras.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const cerebrasModels = {
1111
contextWindow: 64000,
1212
supportsImages: false,
1313
supportsPromptCache: false,
14+
supportsComputerUse: true,
1415
inputPrice: 0,
1516
outputPrice: 0,
1617
description:
@@ -21,6 +22,7 @@ export const cerebrasModels = {
2122
contextWindow: 128000,
2223
supportsImages: false,
2324
supportsPromptCache: false,
25+
supportsComputerUse: true,
2426
inputPrice: 0,
2527
outputPrice: 0,
2628
description:

src/api/providers/__tests__/cerebras.spec.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,61 @@ describe("CerebrasHandler", () => {
175175
// Test fallback token estimation logic
176176
})
177177
})
178+
179+
describe("computer use support", () => {
180+
it("should return supportsComputerUse true for qwen-3-coder-480b-free model", () => {
181+
const testModelId: CerebrasModelId = "qwen-3-coder-480b-free"
182+
const handlerWithModel = new CerebrasHandler({
183+
cerebrasApiKey: "test-api-key",
184+
apiModelId: testModelId,
185+
})
186+
const { id, info } = handlerWithModel.getModel()
187+
// The model ID is routed from qwen-3-coder-480b-free to qwen-3-coder-480b
188+
expect(id).toBe("qwen-3-coder-480b")
189+
// But the info should be from the original model (qwen-3-coder-480b-free)
190+
expect("supportsComputerUse" in info && info.supportsComputerUse).toBe(true)
191+
expect(info.maxTokens).toBe(40000)
192+
expect(info.contextWindow).toBe(64000)
193+
expect(info.inputPrice).toBe(0)
194+
expect(info.outputPrice).toBe(0)
195+
expect(info.description).toContain("SOTA coding model")
196+
expect(info.description).toContain("$0 free tier")
197+
})
198+
199+
it("should return supportsComputerUse true for qwen-3-coder-480b model", () => {
200+
const testModelId: CerebrasModelId = "qwen-3-coder-480b"
201+
const handlerWithModel = new CerebrasHandler({
202+
cerebrasApiKey: "test-api-key",
203+
apiModelId: testModelId,
204+
})
205+
const { id, info } = handlerWithModel.getModel()
206+
expect(id).toBe(testModelId)
207+
expect("supportsComputerUse" in info && info.supportsComputerUse).toBe(true)
208+
expect(info.maxTokens).toBe(40000)
209+
expect(info.contextWindow).toBe(128000)
210+
expect(info.inputPrice).toBe(0)
211+
expect(info.outputPrice).toBe(0)
212+
expect(info.description).toContain("SOTA coding model")
213+
})
214+
215+
it("should not have supportsComputerUse for other Cerebras models", () => {
216+
const otherModels: CerebrasModelId[] = [
217+
"llama-3.3-70b",
218+
"qwen-3-235b-a22b-instruct-2507",
219+
"qwen-3-32b",
220+
"qwen-3-235b-a22b-thinking-2507",
221+
]
222+
223+
otherModels.forEach((modelId) => {
224+
const handlerWithModel = new CerebrasHandler({
225+
cerebrasApiKey: "test-api-key",
226+
apiModelId: modelId,
227+
})
228+
const { id, info } = handlerWithModel.getModel()
229+
expect(id).toBe(modelId)
230+
// Should be undefined or false
231+
expect("supportsComputerUse" in info ? info.supportsComputerUse : undefined).toBeFalsy()
232+
})
233+
})
234+
})
178235
})

0 commit comments

Comments
 (0)