LangChain tool for Sandflare Firecracker microVM sandboxes — run agent-generated code safely
Project description
sandflare-langchain
LangChain tool integration for Sandflare — run agent-generated code in isolated Firecracker microVM sandboxes.
Installation
pip install sandflare-langchain
Usage
from langchain.agents import AgentExecutor, create_openai_tools_agent
from langchain_openai import ChatOpenAI
from sandflare_langchain import SandflareCodeInterpreter
tool = SandflareCodeInterpreter(api_key="sf-...")
llm = ChatOpenAI(model="gpt-4o")
agent = create_openai_tools_agent(llm, [tool], prompt)
executor = AgentExecutor(agent=agent, tools=[tool])
result = executor.invoke({"input": "Plot a sine wave and save it as plot.png"})
How it works
Each tool call creates a fresh Sandflare microVM sandbox, executes the code, streams stdout/stderr back to LangChain, and auto-deletes the sandbox when done.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sandflare_langchain-0.1.4.tar.gz.
File metadata
- Download URL: sandflare_langchain-0.1.4.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63b0f748e9996a73913c9387db605cdb45fc18f257cc12e5826688b37c5cabf0
|
|
| MD5 |
9c9d9b8a1309deb154ffd70c6d4c38d8
|
|
| BLAKE2b-256 |
10ca15acb835e01630d70406524a62b7398cb3928179a86b9354070b7affc6cb
|
File details
Details for the file sandflare_langchain-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sandflare_langchain-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d128e781199bc6f20ac34b255fa25434aa1bdbf5e7b73315ccd86ca9df3bd431
|
|
| MD5 |
11391b8952889c06b36a1066792087d9
|
|
| BLAKE2b-256 |
b30c6e7e475f4b31ed2ad4b45d21e0cf3c816eb4eab8ff032e5e7a70418354e8
|