Skip to main content

smolagents-briq

from smolagents import CodeAgent
from smolagents_briq import BriqExecutor

# Set BRIQ_API_KEY. Supply your configured smolagents Model instance.
with BriqExecutor() as executor:
    agent = CodeAgent(tools=[], model=model, executor=executor)
    result = agent.run("Calculate the first 20 Fibonacci numbers.")

Install with pip install smolagents-briq. The package targets smolagents 1.26.x and briq-cloud 0.1.x (minimum 0.1.1). Direct executor= injection works in released smolagents; no plugin discovery or upstream patch is required. The model is configured separately; no model credentials are sent by this adapter.

Each executor creates and owns a briq sandbox. Python state survives across agent actions. Tools and variables use smolagents' remote-executor protocol; tools execute inside the sandbox and must have serializable source and dependencies. No host tool callback is provided. Expression outputs use Jupyter's text representation. Final answers use smolagents' safe serialization, with pickle always disabled. Return arrays as lists and images as bytes. Rich array and image reconstruction on the host is rejected, including nested values.

The default image is python:3.12-slim. Cold setup installs smolagents 1.26.0, NumPy 1.26/2.x, ipykernel 6/7 and jupyter-client 8 with pip, requiring outbound package access. A custom image must provide python3 and pip. Initial installation has a 60-second command deadline and can fail on slow networks; setup failures destroy the sandbox. There is no prebuilt integration image.

The kernel listens on loopback inside the sandbox. No port is exposed. Commands and results travel through the briq SDK. Code is uploaded as a file, so long actions do not become long shell commands. Logs and text results share a 65,536-character budget per action; rich display formats are not returned. Final answers are limited to 65,536 characters of serialized data. No remote text is evaluated on the host.

execution_timeout defaults to 30 seconds (maximum 40). Timeout interrupts the kernel and marks the executor unusable. A transport failure or malformed response also makes it unusable: create a new executor rather than replaying uncertain code. The adapter serializes execution calls; use one executor per agent.

Use the context manager or call cleanup()/delete() explicitly. Cleanup destroys the sandbox, propagates failures and can be retried. An injected client=Briq(...) stays open. There is no destructor that performs network calls. size is passed through when supplied; otherwise the API chooses its default. sleep defaults to 30m. Sleeping or restarting a sandbox loses the live kernel session.

Verify

uv sync --group test
uv run pytest
uv run ruff check .
uv run python -m build
uv run twine check dist/*

Offline contract tests run a real Jupyter kernel and the shipped bridge through a local subprocess SDK double, plus a deterministic real CodeAgent. They do not call briq or a model API. The 0.1.0 release candidate also passed a live lifecycle smoke against staging and production on 2026-11-09: persistent state, final answers, timeout, refusal to reuse an uncertain executor, and confirmed destruction. No model API was called.

Metadata

Release files for smolagents-briq 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-briq 0.1.0
File Size Uploaded Provenance Actions
smolagents_briq-0.1.0.tar.gz 10.0 kB With provenance Details for smolagents_briq-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / smolagents_briq-0.1.0.tar.gz

Download URL smolagents_briq-0.1.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b734d0c9eb6710e199bab763ddb0555bacf02e93b3a29a06db36325b2a76003c
BLAKE2b-256 checksum
How to use checksums
259bc5dd4ac70b07a3688a14f982c73b2619aaabbc8f47935e4116281fe6065c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

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

Download URL smolagents_briq-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caebdc808736ea3f227ac3de54cf7398cc40e6c413e8e4b14b551536ff347954
BLAKE2b-256 checksum
How to use checksums
9e149813a5699daedaed04a0bb3d323abc106304a6ac37a5a2229e9653b8576c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

Security for smolagents-briq 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for smolagents_briq-0.1.0.tar.gz

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 Nov 9, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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