Starweaver Python
starweaver is the in-process Python SDK and binding package for Starweaver.
It keeps the Rust runtime as the canonical agent loop while exposing Python
ergonomics for agents, tools, models, sessions, streams, resources, media, and
deterministic tests.
Python tools are injected directly as native Starweaver runtime tools. They do not use MCP, stdio, or another binary protocol.
Supported Python versions are CPython 3.11 through 3.13. Local development and single-version CI jobs default to Python 3.13.
Quickstart
import asyncio
from starweaver import create_agent, tool
from starweaver.testing import TestModel
@tool
async def add(left: int, right: int) -> dict[str, int]:
return {"total": left + right}
async def main() -> None:
model = TestModel.responses(
[
TestModel.tool_call_response(
[{"id": "call_add", "name": "add", "arguments": {"left": 2, "right": 3}}]
),
{"text": "done"},
]
)
result = await create_agent(model=model, tools=[add]).run("Add two numbers")
print(result.output)
asyncio.run(main())
Core Surfaces
create_agent()builds a Python facade over the Rust runtime.@tool, raw callables, andBaseToolregister in-process tools.- Independent tool calls run in parallel by default; use
sequential=Truefor ordered side effects. Toolset,ToolSearchToolset, andToolProxyToolsetcompose grouped tools.ProviderModel,TestModel, andFunctionModelcover production providers, deterministic scripts, and callback-backed tests.OutputSchema,OutputPolicy, validators, and output functions handle final output.AgentSessionandSessionArchivepreserve reusable session state.EnvironmentProvider,ResourceRef,SkillRegistry, andMediaUploaderexpose environment, resource, skill, and media boundaries.
Stream Boundary
run_stream() currently returns AgentRun, an async iterator over canonical
StreamEvent records plus a Python facade for recv(), join(), result(),
status(), recoverable_state(), interrupt(), active messages, steering, and
streamed HITL helpers. The stable portable contract is the canonical
StreamEvent.raw record sequence and collected run result. Python live-control
ergonomics are the current facade, not a separately frozen live-handle
protocol.
AgentStream remains a compatibility alias for AgentRun.
Documentation
Start with docs/python-sdk.md in the repository. The Python docs are organized
by feature:
docs/python/agents.mddocs/python/tools.mddocs/python/toolsets.mddocs/python/models.mddocs/python/output.mddocs/python/sessions-streams.mddocs/python/environments-skills.mddocs/python/media.mddocs/python/testing.mddocs/python/examples.mddocs/python/stability.md
Runnable examples live in examples/python/.
Validation
From the repository root:
make py-sync
make py-lint
make py-rust-check
make py-test
make py-wheel-smoke
make py-check
Metadata
Release files for starweaver 0.15.0
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 | |
|---|---|---|---|---|
| starweaver-0.15.0.tar.gz | 1.6 MB | Without provenance | Details |
Built distributions (wheels)
Total release size: 191.3 MB
Release files / starweaver-0.15.0.tar.gz
| Download URL | starweaver-0.15.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80b3a3f236aba50803c0bd1e08a347f4ee055120e0b04bc4db9f7863d36d2965
|
|
BLAKE2b-256 checksum How to use checksums |
9d21162943e498d5049963fe1b72176e18132253b408f6578d9cfff7a0c3ba79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp313-cp313-win_amd64.whl
| Download URL | starweaver-0.15.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 16.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
07f1bffb95efb5e7e0b9953a7803801d2c7f73b722b9425069bee2cbbbb346f0
|
|
BLAKE2b-256 checksum How to use checksums |
37321755c40fd175c5abdb4b0684299a346282f19d5aac4998b8cbeb57818fe7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | starweaver-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 16.6 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4ed492d34baf9d07668bd61c7a31d059a03c9312439b6f5bdb02db9a1d53cf7f
|
|
BLAKE2b-256 checksum How to use checksums |
d05ce0caec83dbf435ffab1a5269139c5e22afd99e57d7ead893b7682d303e8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | starweaver-0.15.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 15.1 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3193bdfec780e2a4d9aed078811d7e43399d2bb61f8a448907cf8612d2e60cea
|
|
BLAKE2b-256 checksum How to use checksums |
e52c186c08b38cb167f658a3a95a258e3f9b398d9adefeeb744c1cc1233db601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | starweaver-0.15.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b3cde930521f018556e1f3caceef831c434b367230f686898446e4de5aaef35f
|
|
BLAKE2b-256 checksum How to use checksums |
9454ab41fa42a24e09a3cbb526d3ea652131612598ea9182cc9a62b78294daff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp312-cp312-win_amd64.whl
| Download URL | starweaver-0.15.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 16.0 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
653efa7193cc0f8d7188e9aec5a8f9c213f2b8a642bc8dd83f3a6dac5fec67cb
|
|
BLAKE2b-256 checksum How to use checksums |
ffd0fa47681928365689f08c7353ea6f022d54048dc866b3b7f67d09da2f7fac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | starweaver-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 16.6 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
495838e17622e7ef81a4c5d02c3248c7bc9aa92cc04d34e83856bf03b88a2989
|
|
BLAKE2b-256 checksum How to use checksums |
291419c0692e9aeff2b8732c55ce240e3be0b98d06385eea8d57daac9e8607e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | starweaver-0.15.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 15.1 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b38b0c9a55419d7ec7286059fdcf15316ad01ac6869f34f6ee1af00df3984414
|
|
BLAKE2b-256 checksum How to use checksums |
d5f21206d8ca48026f5bb8a9feb023b8d2f868e7258d5fff96478175701c6957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | starweaver-0.15.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b97d656646c6277b4128c8b6fdec39e5839869850d7d09901d8f8d87bc5b6945
|
|
BLAKE2b-256 checksum How to use checksums |
15cb481f9d964dd4cf7dfa8fbcb06d48e047b00d5eee9e8fe4c304c9d4f660fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp311-cp311-win_amd64.whl
| Download URL | starweaver-0.15.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 16.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0a3cb454569be1d861f347c5513b242ac2a026f5d68f36101dea9b2ed64ccff4
|
|
BLAKE2b-256 checksum How to use checksums |
78479ce4190e14eef7ae126a4c2a872b83b0cdb1986f1479ec5df33c03c4b683
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | starweaver-0.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 16.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
74118f8f523ccfcaacae714474b4d3e0a49f83dcc26aa43387b1c3cb795e373c
|
|
BLAKE2b-256 checksum How to use checksums |
45926908cc3f0225aa321cbfeb69fa32e962a9d0c95c4ae7c43e1be4bee9fdc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | starweaver-0.15.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 15.1 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d4d2f4e9911e12b422f3a89d0bdd64a18af1b1321dcf1c461616e9bed876c350
|
|
BLAKE2b-256 checksum How to use checksums |
df2f3198044dc23a576813b4dbd8421baffe9efeba362ee9f06bfce8703c35ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / starweaver-0.15.0-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | starweaver-0.15.0-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
1472d192ac589f74ad2fde4870af986e8fdedf696d85e0eba78931e5c511b9fd
|
|
BLAKE2b-256 checksum How to use checksums |
1ac93eacc176d78dbed21abdaae61b44b4bb79ce963624c90dc8b043ba2a5366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for starweaver 0.15.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.
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.