Repository: browser-use/browser-use
Pull request #1391: Add Novita AI example and documentation
Author: login: jasonhp
Created: 2025-04-16T10:26:47Z | Merged: 2025-04-16T21:56:57Z

<!-- This is an auto-generated description by mrge. -->
## Summary by mrge
Added Novita AI integration with example code and documentation. This enables users to leverage Novita AI's models through the browser-use agent framework.

**New Features**
- Added Novita AI example in `examples/models/novita.py` with a complete working implementation.
- Updated documentation in `supported-models.mdx` with Novita AI setup instructions.
- Added code sample showing how to configure the agent with Novita AI's deepseek model.

**Dependencies**
- Uses existing OpenAI API key for authentication with Novita AI's API.

<!-- End of auto-generated description by mrge. -->

1. Add Novita AI usecase in `examples/models/novita.py`.
2. Add Novita AI sample code in `docs/customize/supported-models.mdx`.


Diff:
diff --git a/.env.example b/.env.example
index ecd4f279fe..7eb471d1fb 100644
--- a/.env.example
+++ b/.env.example
@@ -5,6 +5,7 @@ AZURE_OPENAI_API_KEY=
 GEMINI_API_KEY=
 DEEPSEEK_API_KEY=
 GROK_API_KEY=
+NOVITA_API_KEY=
 
 # Set to false to disable anonymized telemetry
 ANONYMIZED_TELEMETRY=true
diff --git a/README.md b/README.md
index 7fc09396d2..8ec309a3a0 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ AZURE_OPENAI_API_KEY=
 GEMINI_API_KEY=
 DEEPSEEK_API_KEY=
 GROK_API_KEY=
+NOVITA_API_KEY=
 ```
 
 For other settings, models, and more, check out the [documentation 📕](https://docs.browser-use.com).
diff --git a/docs/customize/supported-models.mdx b/docs/customize/supported-models.mdx
index 8ae3012416..73c561f2d1 100644
--- a/docs/customize/supported-models.mdx
+++ b/docs/customize/supported-models.mdx
@@ -220,6 +220,36 @@ agent = Agent(
 
 Required environment variables: None!
 
+### Novita AI
+[Novita AI](https://novita.ai) is an LLM API provider that offers a wide range of models. Note: choose a model that supports function calling.
+
+```python
+from langchain_openai import ChatOpenAI
+from browser_use import Agent
+from pydantic import SecretStr
+from dotenv import load_dotenv
+import os
+
+load_dotenv()
+api_key = os.getenv("NOVITA_API_KEY")
+
+# Initialize the model
+llm = ChatOpenAI(base_url='https://api.novita.ai/v3/openai', model='deepseek/deepseek-v3-0324', api_key=SecretStr(api_key))
+
+# Create agent with the model
+agent = Agent(
+    task="Your task here",
+    llm=llm,
+    use_vision=False
+)
+```
+
+Required environment variables:
+
+```bash .env
+NOVITA_API_KEY=
+```
+
 ## Coming soon
 (We are working on it)
 - Groq
diff --git a/docs/development/local-setup.mdx b/docs/development/local-setup.mdx
index a0c97a2c24..b8566d6c5b 100644
--- a/docs/development/local-setup.mdx
+++ b/docs/development/local-setup.mdx
@@ -51,6 +51,8 @@ AZURE_ENDPOINT=
 AZURE_OPENAI_API_KEY=
 GEMINI_API_KEY=
 DEEPSEEK_API_KEY=
+GROK_API_KEY=
+NOVITA_API_KEY=
 ```
 
 <Note>
diff --git a/examples/models/novita.py b/examples/models/novita.py
new file mode 100644
index 0000000000..0959fca710
--- /dev/null
+++ b/examples/models/novita.py
@@ -0,0 +1,44 @@
+"""
+Simple try of the agent.
+
+@dev You need to add NOVITA_API_KEY to your environment variables.
+"""
+
+import asyncio
+import os
+
+from dotenv import load_dotenv
+from langchain_openai import ChatOpenAI
+from pydantic import SecretStr
+
+from browser_use import Agent
+
+# dotenv
+load_dotenv()
+
+api_key = os.getenv('NOVITA_API_KEY', '')
+if not api_key:
+	raise ValueError('NOVITA_API_KEY is not set')
+
+
+async def run_search():
+	agent = Agent(
+		task=(
+			'1. Go to https://www.reddit.com/r/LocalLLaMA '
+			"2. Search for 'browser use' in the search bar"
+			'3. Click on first result'
+			'4. Return the first comment'
+		),
+		llm=ChatOpenAI(
+			base_url='https://api.novita.ai/v3/openai',
+			model='deepseek/deepseek-v3-0324',
+			api_key=SecretStr(api_key),
+		),
+		use_vision=False,
+	)
+
+	await agent.run()
+
+
+if __name__ == '__main__':
+	asyncio.run(run_search())


Reviews:
user: login: cubic-dev-ai[bot]
body: mrge found 2 issues across 2 files. View them in [mrge.io](https://mrge.io/pr/browser-use/browser-use/pull/1391)
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T10:29:07Z
user: login: pirate
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T21:55:48Z
user: login: pirate
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T21:56:20Z

Review comments:
diff_hunk: @@ -220,6 +220,34 @@ agent = Agent(
 
 Required environment variables: None!
 
+### Novita AI
+```python
+from langchain_openai import ChatOpenAI
+from browser_use import Agent
+from pydantic import SecretStr
+from dotenv import load_dotenv
+import os
+
+load_dotenv()
+api_key = os.getenv("OPENAI_API_KEY")
path: docs/customize/supported-models.mdx
user: login: cubic-dev-ai[bot]
body: Using OPENAI_API_KEY for a non-OpenAI service creates confusion
created_at: 2025-04-16T10:29:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -220,6 +220,34 @@ agent = Agent(
 
 Required environment variables: None!
 
+### Novita AI
+```python
+from langchain_openai import ChatOpenAI
path: docs/customize/supported-models.mdx
user: login: cubic-dev-ai[bot]
body: No brief description of what Novita AI is in the documentation
created_at: 2025-04-16T10:29:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -220,6 +220,36 @@ agent = Agent(
 
 Required environment variables: None!
 
+### Novita AI
+[Novita AI](https://novita.ai) is an LLM API provider that offers a wide range of models. Note: choose a model that supports function calling.
+
+```python
+from langchain_openai import ChatOpenAI
+from browser_use import Agent
+from pydantic import SecretStr
+from dotenv import load_dotenv
+import os
+
+load_dotenv()
+api_key = os.getenv("NOVITA_API_KEY")
+
+# Initialize the model
+llm=ChatOpenAI(base_url='https://api.novita.ai/v3/openai', model='deepseek/deepseek-v3-0324', api_key=SecretStr(api_key))
path: docs/customize/supported-models.mdx
user: login: pirate
body: ```suggestion
llm = ChatOpenAI(base_url='https://api.novita.ai/v3/openai', model='deepseek/deepseek-v3-0324', api_key=SecretStr(api_key))
```
created_at: 2025-04-16T21:55:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -51,6 +51,7 @@ AZURE_ENDPOINT=
 AZURE_OPENAI_API_KEY=
 GEMINI_API_KEY=
 DEEPSEEK_API_KEY=
+NOVITA_API_KEY=
path: docs/development/local-setup.mdx
user: login: pirate
body: ```suggestion
GROK_API_KEY=
NOVITA_API_KEY=
```
created_at: 2025-04-16T21:56:20Z
author_association: CONTRIBUTOR

PR comments:
user: login: CLAassistant
created_at: 2025-04-16T10:26:59Z
body: [![CLA assistant check](https://cla-assistant.io/pull/badge/signed)](https://cla-assistant.io/browser-use/browser-use?pullRequest=1391) <br/>All committers have signed the CLA.
author_association: NONE
user: login: pirate
created_at: 2025-04-16T21:57:02Z
body: ok this is better, thanks. Can you sign that CLA too please
author_association: CONTRIBUTOR