Skip to main content

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, and BaseTool register in-process tools.
  • Independent tool calls run in parallel by default; use sequential=True for ordered side effects.
  • Toolset, ToolSearchToolset, and ToolProxyToolset compose grouped tools.
  • ProviderModel, TestModel, and FunctionModel cover production providers, deterministic scripts, and callback-backed tests.
  • OutputSchema, OutputPolicy, validators, and output functions handle final output.
  • AgentSession and SessionArchive preserve reusable session state.
  • EnvironmentProvider, ResourceRef, SkillRegistry, and MediaUploader expose 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.md
  • docs/python/tools.md
  • docs/python/toolsets.md
  • docs/python/models.md
  • docs/python/output.md
  • docs/python/sessions-streams.md
  • docs/python/environments-skills.md
  • docs/python/media.md
  • docs/python/testing.md
  • docs/python/examples.md
  • docs/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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starweaver-0.10.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

starweaver-0.10.0-cp313-cp313-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.10.0-cp313-cp313-macosx_11_0_arm64.whl (14.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.10.0-cp313-cp313-macosx_10_12_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.10.0-cp312-cp312-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.10.0-cp312-cp312-macosx_11_0_arm64.whl (14.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.10.0-cp312-cp312-macosx_10_12_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.10.0-cp311-cp311-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.10.0-cp311-cp311-macosx_11_0_arm64.whl (14.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.10.0-cp311-cp311-macosx_10_12_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file starweaver-0.10.0.tar.gz.

File metadata

  • Download URL: starweaver-0.10.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0.tar.gz
Algorithm Hash digest
SHA256 25c9b2a72093258d44e0fc7c49fa3befe2071ef86f3da68ba36b54e8d273735b
MD5 5d10bdaf62e47e0a80feba0a62005ffa
BLAKE2b-256 1655d4d1a459a164871a2d45fc1a68c98dc3b59ca4da6d94c2a8f50c3672a2a7

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c2f1bfb84c3e517a184b8098ccf0ada184a1fbd05191765dd1faebbabbc9c6dd
MD5 1853a81cd9f350b24298e86d114198d7
BLAKE2b-256 00eca308800947c3e9c8a77394ad1dfff7b8a2a1dae48c7659c13c2ee8a2f9b0

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbb560421b3ae26bd21cf0cf127485db10854e50083e207a06c9978386a4b974
MD5 1588f06337182a7f2f9c2823cbf2e760
BLAKE2b-256 0210b18ef49c086c034f67457e2ca9cf1d2be919c2e8c4bca7895a7b5ad56c66

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39f73e79285e7c1b1e5c2f1656f330ea7c391bb309204c9be20af1265233f525
MD5 35a16a42c6d60e73782bd80bc685de8d
BLAKE2b-256 179705dba0f0e2cbb0df93d67f3095b5a74bae2deecf4ffc71f84859e5807d36

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ccf98db6785ad103da0b9e5d5fdfa89d73f818e5dd6b9fece78c186e1cb91d5
MD5 257b2612cdd1b6b32898f03d4bec5d5b
BLAKE2b-256 726f1d23af0dc8f5856b675d203fdb752b3f69e9396397d486ec825ad3b88eb0

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c61efe1c8a648b2c15c0670ef265c323b86d0791891ecaf148f145212dd0e55d
MD5 0eaad8389997e7f870ab655d7b015b41
BLAKE2b-256 6ef7af66c21dbd83fd8ce793242bda4d49055c093ef5da9cb017fe3b0481a5b9

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd0ded67b30057084cb709061465139acbebd2f55830c1d14cff8a75e860d202
MD5 7e1736c8b8b15400aeb98b6241085878
BLAKE2b-256 f1e3247339f90ea99286bbf5bff57be6c1e950b08d9860e3943fba2876cfd761

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f08fce28058b27fbdfcda9ee5ff8b6813fa550528449e4cc87acd11fc0f29dc
MD5 cd613902a8804fe8cb4d0c80b3150309
BLAKE2b-256 c398abc7930a7ecc2bb8b27ed19fb2d1402df7a17dd4eccfc5a4dc44b0814eb0

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3e92c0798b39decf30aad8839a9faf1fdadf6c578263b1f73267b1364c77a958
MD5 786bcac2a6e1baf1d196fd929a01bb7d
BLAKE2b-256 067d14c3d07254fe7206a29322a9a1c5505f803bb54a8fcb6c8e43bff25481c1

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b3207c2922fcd51be4c26da77627c0d11f8dce8217163b21f737e159ae3a6c9e
MD5 0836bf7b0e6960e3ecc5e57c334eb14b
BLAKE2b-256 cc0d294e620a218d30e04a15d7923a47c315726eea4ce9fb6e231f44d9074cba

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c5fd9f2a9a33a8521db349fb6a40f9e8141a13e854562d2ecedd3d69495a89a
MD5 112cb1061ac9e2f1f58f909391583933
BLAKE2b-256 41b8b9d7c64faabd22cdfea3fc82a6dd5234ebfc6fa89dd8eeea360ec0395557

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a8dc9241ce446cf6e87765c1e1ca2af0725ffc2b58e3c11a71d78ab31602bdde
MD5 8e3bb9493a160832ffa6ecbedd3cb19a
BLAKE2b-256 3030055b01ba01e61ece925241b2233139ba2249e89ec332445c767f92eb2f97

See more details on using hashes here.

File details

Details for the file starweaver-0.10.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: starweaver-0.10.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

File hashes

Hashes for starweaver-0.10.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 69a1cef36658edd93bbe28f2de82c4b2877282f3a9e2f5de09e8ed3580c08c90
MD5 295beb6c3a621cdebb6b3d76d988f001
BLAKE2b-256 9fa523d34399d1a8b2dd2b1f45969f41c0e21d05340b08837b058cd465c98a5a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.15.0

13 files

0.14.0

13 files

0.13.0

13 files

0.12.0

13 files

0.11.0

13 files

This release

0.10.0 This release

13 files

0.9.0

13 files

0.8.1

13 files

0.8.0

13 files

0.7.0

13 files

0.6.0

13 files

0.5.1

13 files

0.5.0

13 files

0.4.1

13 files

0.4.0

13 files

0.3.0

13 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