Can Stagehand Python SDK work with non-OpenAI models like DeepSeek or Qwen? #1832
Unanswered
zhuangxlace
asked this question in
Q&A
Replies: 1 comment
-
|
For the current Python SDK, don't use the TS-style custom OpenAI client path. The v3 migration docs say custom Python LLM client classes aren't supported yet, but OpenAI-compatible custom endpoints / proxies are supported. The supported shape is to pass the model key on the client and the model name when starting the session: client = Stagehand(
browserbase_api_key=os.environ["BROWSERBASE_API_KEY"],
model_api_key=os.environ["DEEPSEEK_API_KEY"],
)
session = client.sessions.start(
model_name="deepseek/deepseek-chat",
x_language="python",
)So DeepSeek should be used as a first-class |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve successfully used Stagehand with TypeScript to run browser automation powered by third-party LLMs such as DeepSeek and Qwen (Tongyi Qianwen) by configuring custom baseURL and API keys via the OpenAI-compatible interface.
However, I’m struggling to achieve the same in Python. The official documentation doesn’t clearly state whether the Python SDK supports plugging in non-Gemini/GPT/Claude models — especially those that are OpenAI-compatible (like DeepSeek or Qwen).
Has anyone successfully integrated DeepSeek, Qwen, or other OpenAI-compatible LLMs into Stagehand’s Python SDK?
If so, could you please share:
The correct way to configure the client or environment variables?
Whether the Python SDK truly supports arbitrary OpenAI-compatible endpoints?
Any working code examples would be greatly appreciated!
I believe this would help many developers in regions where GPT/Claude aren’t easily accessible but local models (e.g., from Alibaba, DeepSeek) are preferred for cost, latency, or compliance reasons.
Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions