Skip to main content

smolagents-lizard

Lizard (lizard.build) provides a remote Python executor for smolagents. The agent and model calls stay on the host; generated Python runs in a persistent kernel in Lizard Sandboxes.

Install and use

Requires Python 3.11+, smolagents 1.26, a Lizard project, and a project API key.

pip install smolagents-lizard

Set LIZARD_API_KEY and LIZARD_PROJECT_ID. The example also needs HF_TOKEN for its model provider.

from smolagents import CodeAgent, InferenceClientModel
from smolagents_lizard import LizardExecutor

with LizardExecutor() as executor:
    agent = CodeAgent(tools=[], model=InferenceClientModel(), executor=executor)
    print(agent.run("Use Python to sum the integers from 1 to 100."))

Pass the executor instance through executor=. This package works with the released 1.26 API and does not use a pending executor registry. It pins smolagents below 1.27 because 1.26 exposes final-answer decoding through a private base-class method.

Behavior

  • Python variables persist until cleanup.
  • additional_imports=["numpy"] installs packages in the remote kernel.
  • The base executor sends tools and state through the smolagents protocol.
  • Final answers support the base executor's safe formats. Pickle decoding stays disabled.
  • Python failures raise AgentError with remote logs and traceback.
  • Use the context manager or call cleanup(). A failed deletion retains its handle for retry.

Options include project_id, api_key, api_url, size, lifetime_ms, and command_timeout_ms. Defaults are a small interpreter sandbox, a 15-minute lifetime, and a 60-second code timeout; the maximum code timeout is 120 seconds.

Remote Python is not restricted by the local executor's import allowlist. Managed agents and host-only tools do not move to the sandbox. Only pass tools whose source and dependencies work in a remote Python process. The package does not offer arbitrary Docker images or return host Python objects through pickle.

Checks

pip install -e '.[dev]'
pytest tests -m 'not live' --disable-socket --allow-unix-socket
# With Lizard credentials:
LIZARD_LIVE_TESTS=1 pytest tests -m live

Cloud tests cover persistent variables, package installation, state and tools, a safe final answer, and CodeAgent with a scripted model.

Metadata

Release files for smolagents-lizard 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smolagents-lizard 0.1.0
File Size Uploaded
smolagents_lizard-0.1.0.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smolagents-lizard 0.1.0
File Interpreter ABI Platform
smolagents_lizard-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / smolagents_lizard-0.1.0.tar.gz

Download URL smolagents_lizard-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e398e0dea12d8ad2fed7f9d7d4a711bddeba28c1b77f44e6ca54169c329f0aa
BLAKE2b-256 checksum
How to use checksums
6c56adde1940873ad9ed3a14e59c8aea5a2a3001c37ffa79b85964f4f44d5a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / smolagents_lizard-0.1.0-py3-none-any.whl

Download URL smolagents_lizard-0.1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e0dea2473b233445dc1f948d0bfd22f05c264db9948eec9c70e42d5e89fd1ce
BLAKE2b-256 checksum
How to use checksums
a978fc9c2a67797ac99d976805a24bc05c02803c81ef4daee6688b9e85dc5d25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page