langchain-novita
Novita sandbox backend integration for LangChain Deep Agents.
Novita provides code interpreter sandboxes for running commands in isolated environments. See the Novita docs for signup, authentication, and platform details.
Installation
pip install -U langchain-novita
uv add langchain-novita
Set your Novita credentials:
export NOVITA_API_KEY="your-api-key"
Create a sandbox backend
In Python, create the sandbox using the Novita SDK, then wrap it with the Deep Agents backend:
from novita_sandbox.code_interpreter import Sandbox
from langchain_novita import NovitaSandbox
sandbox = Sandbox.create()
backend = NovitaSandbox(sandbox=sandbox)
result = backend.execute("echo hello")
print(result.output)
Use with Deep Agents
Novita's LLM API is compatible with OpenAI's Chat Completions API. To use Novita models with Deep Agents, install langchain-openai and configure ChatOpenAI with Novita's base URL.
pip install -U langchain-openai
Set the model ID:
export NOVITA_MODEL_ID="deepseek/deepseek-v4-pro"
import os
from langchain_openai import ChatOpenAI
from novita_sandbox.code_interpreter import Sandbox
from deepagents import create_deep_agent
from langchain_novita import NovitaSandbox
sandbox = Sandbox.create()
backend = NovitaSandbox(sandbox=sandbox)
model = ChatOpenAI(
model=os.environ["NOVITA_MODEL_ID"],
api_key=os.environ["NOVITA_API_KEY"],
base_url="https://api.novita.ai/openai",
)
agent = create_deep_agent(
model=model,
system_prompt="You are a coding assistant with sandbox access.",
backend=backend,
)
result = agent.invoke(
{
"messages": [
{"role": "user", "content": "Create a hello world Python script and run it"}
]
}
)
Cleanup
You are responsible for managing the sandbox lifecycle via the Novita SDK. When you are done, kill the sandbox:
sandbox.kill()
Testing
Install test dependencies:
poetry install --with test
Run unit tests:
poetry run pytest tests/unit_tests
Run the standard sandbox integration tests:
export NOVITA_API_KEY="your-api-key"
poetry run pytest tests/integration_tests/test_sandbox.py
Metadata
Release files for langchain-novita 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_novita-0.1.1.tar.gz | 4.2 kB | Without provenance | Details for langchain_novita-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_novita-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for langchain_novita-0.1.1-py3-none-any.whl |
Total release size: 9.1 kB
Release files / langchain_novita-0.1.1.tar.gz
| Download URL | langchain_novita-0.1.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1505ae302f33f9249479fb06ffeb501e961e0ba3a645508af752aa7da6ea31eb
|
|
BLAKE2b-256 checksum How to use checksums |
cca3b072440b682536602d1fc3d98a73cf75e3f6c85c8cbe1caf091904e762cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.2 Darwin/25.3.0
|
Release files / langchain_novita-0.1.1-py3-none-any.whl
| Download URL | langchain_novita-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a77dc7d49c19f827e9e90bca4be1b80aa43c60785f38fbe43e1f3f690472f64c
|
|
BLAKE2b-256 checksum How to use checksums |
84b16bb5d23d89c78661ee43d42910a06cf021c5a8ba7c3ab7797604f960884a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.2 Darwin/25.3.0
|
Security for langchain-novita 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.