Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/remove-groq-cerebras.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@browserbasehq/stagehand-protocol": major
"@browserbasehq/stagehand-extension": patch
"@browserbasehq/stagehand-python": patch
"@browserbasehq/stagehand-go": patch
"@browserbasehq/stagehand": patch
---

Remove native Groq and Cerebras provider support.
5 changes: 1 addition & 4 deletions packages/docs/v2/configuration/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Set up your API keys before configuring Stagehand:
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
GOOGLE_API_KEY=your_google_key_here
GROQ_API_KEY=your_groq_key_here
```
</CodeGroup>

Expand All @@ -54,10 +53,8 @@ Stagehand supports major LLM providers with structured output capabilities:
### Additional Providers

<Expandable title="More Providers">
- **Groq** - `llama-3.3-70b-versatile` (Good for speed critical applications)
- **xAI** - `grok-beta` (Good for complex reasoning)
- **Azure** - Enterprise OpenAI deployment
- **Cerebras** - High-speed inference
- **TogetherAI** - Open-source models
- **Mistral** - `mixtral-8x7b-32768` (European option)
- **DeepSeek** - Cost-effective alternative
Expand Down Expand Up @@ -302,4 +299,4 @@ For each provider, use their latest models that meet these requirements. Some ex
<Card title="Cache Results" href="/v2/best-practices/caching" icon="database">
Store successful patterns using our Caching Guide
</Card>
</CardGroup>
</CardGroup>
53 changes: 0 additions & 53 deletions packages/docs/v3/configuration/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -340,24 +340,6 @@ For Microsoft Entra ID authentication, pass the bearer token explicitly in `auth
[View all supported Azure models →](https://ai.azure.com/catalog)
</Tab>

<Tab title="Cerebras">
<CodeGroup>
```typescript TypeScript
import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
env: "BROWSERBASE",
model: "cerebras/llama-4-scout"
// API key auto-loads from CEREBRAS_API_KEY - set in your .env
});

await stagehand.init();
```

</CodeGroup>
[View all supported Cerebras models →](https://inference-docs.cerebras.ai/models/overview)
</Tab>

<Tab title="DeepSeek">

<CodeGroup>
Expand All @@ -377,26 +359,6 @@ await stagehand.init();
[View all supported DeepSeek models →](https://api-docs.deepseek.com/quick_start/pricing)
</Tab>

<Tab title="Groq">


<CodeGroup>
```typescript TypeScript
import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
env: "BROWSERBASE",
model: "groq/llama-3.1-8b-instant"
// API key auto-loads from GROQ_API_KEY - set in your .env
});

await stagehand.init();
```

</CodeGroup>
[View all supported Groq models →](https://console.groq.com/docs/models)
</Tab>

<Tab title="Mistral">

<CodeGroup>
Expand Down Expand Up @@ -1003,19 +965,6 @@ The following models work without the `provider/` prefix in the model parameter
- `gpt-4o-2024-08-06`
- `o1-preview`

</Accordion>
<Accordion title="Cerebras">

- `cerebras-llama-3.3-70b`
- `cerebras-llama-3.1-8b`

</Accordion>
<Accordion title="Groq">

- `groq-llama-3.3-70b-versatile`
- `groq-llama-3.3-70b-specdec`
- `moonshotai/kimi-k2-instruct`

</Accordion>
</AccordionGroup>

Expand All @@ -1042,9 +991,7 @@ The following models work without the `provider/` prefix in the model parameter
| Anthropic | `ANTHROPIC_API_KEY` |
| OpenAI | `OPENAI_API_KEY` |
| Azure | `AZURE_API_KEY` |
| Cerebras | `CEREBRAS_API_KEY` |
| DeepSeek | `DEEPSEEK_API_KEY` |
| Groq | `GROQ_API_KEY` |
| Mistral | `MISTRAL_API_KEY` |
| Ollama | None (local) |
| Perplexity | `PERPLEXITY_API_KEY` |
Expand Down
134 changes: 1 addition & 133 deletions packages/docs/v4/configuration/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -538,136 +538,6 @@ OpenAI models are called through the Responses API.
[View all supported OpenAI models →](https://platform.openai.com/docs/models)
</Tab>

<Tab title="Groq">

<Tabs>
<Tab title="TypeScript">
```typescript
import { browserbase, Stagehand } from "@browserbasehq/stagehand";

const stagehand = await Stagehand.create({
browser: await browserbase.launch({ apiKey: process.env.BROWSERBASE_API_KEY }),
model: {
modelName: "groq/llama-3.3-70b-versatile",
},
});
```
</Tab>

<Tab title="Python">
```python
import os

from stagehand import Stagehand, browserbase

browser = await browserbase.launch(api_key=os.environ["BROWSERBASE_API_KEY"])

stagehand = await Stagehand.create(
browser=browser,
model="groq/llama-3.3-70b-versatile",
model_api_key=os.environ["GROQ_API_KEY"],
)
```
</Tab>

<Tab title="Go">
```go
apiKey := os.Getenv("BROWSERBASE_API_KEY")
modelAPIKey := os.Getenv("GROQ_API_KEY")
model := stagehand.ModelConfig{
ModelName: "groq/llama-3.3-70b-versatile",
APIKey: &modelAPIKey,
}

browser, err := stagehand.LaunchBrowserbase(ctx, stagehand.BrowserbaseLaunchOptions{
APIKey: apiKey,
})
if err != nil {
return err
}

client, err := stagehand.Create(ctx, stagehand.CreateOptions{
Browser: browser,
Model: &model,
})
if err != nil {
return err
}
defer func() { err = errors.Join(err, client.Close(ctx)) }()
```
</Tab>
</Tabs>

Commonly used: `groq/llama-3.3-70b-versatile`, `groq/openai/gpt-oss-120b`, `groq/moonshotai/kimi-k2-instruct-0905`, `groq/qwen/qwen3-32b`.

[View all supported Groq models →](https://console.groq.com/docs/models)
</Tab>

<Tab title="Cerebras">

<Tabs>
<Tab title="TypeScript">
```typescript
import { browserbase, Stagehand } from "@browserbasehq/stagehand";

const stagehand = await Stagehand.create({
browser: await browserbase.launch({ apiKey: process.env.BROWSERBASE_API_KEY }),
model: {
modelName: "cerebras/gpt-oss-120b",
},
});
```
</Tab>

<Tab title="Python">
```python
import os

from stagehand import Stagehand, browserbase

browser = await browserbase.launch(api_key=os.environ["BROWSERBASE_API_KEY"])

stagehand = await Stagehand.create(
browser=browser,
model="cerebras/gpt-oss-120b",
model_api_key=os.environ["CEREBRAS_API_KEY"],
)
```
</Tab>

<Tab title="Go">
```go
apiKey := os.Getenv("BROWSERBASE_API_KEY")
modelAPIKey := os.Getenv("CEREBRAS_API_KEY")
model := stagehand.ModelConfig{
ModelName: "cerebras/gpt-oss-120b",
APIKey: &modelAPIKey,
}

browser, err := stagehand.LaunchBrowserbase(ctx, stagehand.BrowserbaseLaunchOptions{
APIKey: apiKey,
})
if err != nil {
return err
}

client, err := stagehand.Create(ctx, stagehand.CreateOptions{
Browser: browser,
Model: &model,
})
if err != nil {
return err
}
defer func() { err = errors.Join(err, client.Close(ctx)) }()
```
</Tab>
</Tabs>

Commonly used: `cerebras/gpt-oss-120b`, `cerebras/qwen-3-235b-a22b-instruct-2507`, `cerebras/zai-glm-4.7`, `cerebras/llama3.1-8b`.

[View all supported Cerebras models →](https://inference-docs.cerebras.ai/models/overview)
</Tab>

</Tabs>

---
Expand Down Expand Up @@ -1744,8 +1614,6 @@ You pinned a `model` but gave it no `apiKey`, and the browser is not a Browserba
| Google | `GOOGLE_GENERATIVE_AI_API_KEY` or `GEMINI_API_KEY` |
| Anthropic | `ANTHROPIC_API_KEY` |
| OpenAI | `OPENAI_API_KEY` |
| Groq | `GROQ_API_KEY` |
| Cerebras | `CEREBRAS_API_KEY` |
| Bring your own LLM | None; your callback owns its credentials |

</Accordion>
Expand All @@ -1756,7 +1624,7 @@ You pinned a `model` but gave it no `apiKey`, and the browser is not a Browserba
**Solutions:**

- Use the `provider/model` format: `openai/gpt-5`. The prefix is required; bare model names are rejected
- Use one of the five supported providers: `openai`, `anthropic`, `google`, `groq`, `cerebras`
- Use one of the three supported providers: `openai`, `anthropic`, `google`
- Check the model ID against the lists on this page. Stagehand validates the whole name, so a typo fails at `Stagehand.create()` rather than on the first inference
- Upgrade the SDK if the model shipped after your installed version
- For a provider outside that list, use the [bring-your-own-LLM callback](#custom-models)
Expand Down
2 changes: 0 additions & 2 deletions packages/evals/initStagehand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const PROVIDER_API_KEY_ENV: Record<string, string[]> = {
openai: ["OPENAI_API_KEY"],
anthropic: ["ANTHROPIC_API_KEY"],
google: ["GOOGLE_GENERATIVE_AI_API_KEY", "GEMINI_API_KEY"],
groq: ["GROQ_API_KEY"],
cerebras: ["CEREBRAS_API_KEY"],
};

type StagehandLogEvent = Parameters<NonNullable<StagehandClientLoggingConfig["onLog"]>>[0];
Expand Down
10 changes: 0 additions & 10 deletions packages/evals/taskConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ const ALL_EVAL_MODELS = [
// TOGETHER - DEEPSEEK
"deepseek-ai/DeepSeek-V3",
"Qwen/Qwen2.5-7B-Instruct-Turbo",
// GROQ
"groq/meta-llama/llama-4-scout-17b-16e-instruct",
"groq/llama-3.3-70b-versatile",
"groq/llama3-70b-8192",
"groq/qwen-qwq-32b",
"groq/qwen-2.5-32b",
"groq/deepseek-r1-distill-qwen-32b",
"groq/deepseek-r1-distill-llama-70b",
// CEREBRAS
"cerebras/llama3.3-70b",
];

// ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/llm/LLMClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export interface LLMParsedResponse<T> {
}

export abstract class LLMClient {
public abstract type: "openai" | "anthropic" | "cerebras" | "groq" | (string & {});
public abstract type: "openai" | "anthropic" | (string & {});
public modelName: ModelName;
public hasVision = false;
// Compile-only bridge: provider SDK option types diverge from V3's shared options.
Expand Down
4 changes: 0 additions & 4 deletions packages/extension/llm/LLMProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { LLMClient } from "./LLMClient.js";
import { createOpenAI } from "@ai-sdk/openai";
import { createAnthropic } from "@ai-sdk/anthropic";
import { createGoogleGenerativeAI } from "@ai-sdk/google";
import { createGroq } from "@ai-sdk/groq";
import { createCerebras } from "@ai-sdk/cerebras";
import { wrapLanguageModel } from "ai";

// Compile-only bridge: current AI SDK providers return mixed v2/v3/v4 model
Expand All @@ -23,8 +21,6 @@ const AISDKProviderFactories: Record<ModelProvider, AISDKProviderFactory> = {
openai: createOpenAI as AISDKProviderFactory,
anthropic: createAnthropic as AISDKProviderFactory,
google: createGoogleGenerativeAI as AISDKProviderFactory,
groq: createGroq as AISDKProviderFactory,
cerebras: createCerebras as AISDKProviderFactory,
};

type AISDKProviderClientOptions = ClientOptions & Record<string, unknown>;
Expand Down
8 changes: 0 additions & 8 deletions packages/extension/llm/aiSdkClient.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { createAnthropic } from "@ai-sdk/anthropic";
import { createCerebras } from "@ai-sdk/cerebras";
import { createGoogleGenerativeAI } from "@ai-sdk/google";
import { createGroq } from "@ai-sdk/groq";
import { createOpenAI } from "@ai-sdk/openai";
import { generateText, jsonSchema, Output } from "ai";
import type { LanguageModel, ModelMessage, ToolSet } from "ai";
import { z } from "zod/v4";
import {
AnthropicModelIdSchema,
CerebrasModelIdSchema,
createLLMGenerateResultSchema,
GoogleModelIdSchema,
GroqModelIdSchema,
LLMGenerateParamsSchema,
LLMMessageSchema,
LLMGenerateResultSchema,
Expand Down Expand Up @@ -163,10 +159,6 @@ export function createAiSdkLanguageModel(
})(AnthropicModelIdSchema.parse(modelId));
case "google":
return createGoogleGenerativeAI(connection)(GoogleModelIdSchema.parse(modelId));
case "groq":
return createGroq(connection)(GroqModelIdSchema.parse(modelId));
case "cerebras":
return createCerebras(connection)(CerebrasModelIdSchema.parse(modelId));
}
}

Expand Down
10 changes: 0 additions & 10 deletions packages/extension/llm/aisdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ export class AISdkClient extends LLMClient {
structuredOutputs: true,
};
break;
case "groq":
providerOptions.groq = {
structuredOutputs: true,
};
break;
case "cerebras":
providerOptions.cerebras = {
strictJsonSchema: true,
};
break;
case "mistral":
providerOptions.mistral = {
structuredOutputs: true,
Expand Down
2 changes: 0 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
},
"dependencies": {
"@ai-sdk/anthropic": "catalog:",
"@ai-sdk/cerebras": "catalog:",
"@ai-sdk/google": "catalog:",
"@ai-sdk/groq": "catalog:",
"@ai-sdk/openai": "catalog:",
"@ai-sdk/provider": "catalog:",
"@opentelemetry/api": "catalog:",
Expand Down
Loading
Loading