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.5.0.tar.gz (987.6 kB view details)

Uploaded Source

Built Distributions

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

starweaver-0.5.0-cp313-cp313-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.5.0-cp312-cp312-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.5.0-cp311-cp311-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.5.0.tar.gz
  • Upload date:
  • Size: 987.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0.tar.gz
Algorithm Hash digest
SHA256 9be1068d941ebcf5ca90a2740e7af4868338e860ce9a73383f59aaf47316116a
MD5 57187000d00b2521e7e43f4208ff9979
BLAKE2b-256 f1792834e5ab8aabe573c7a63faaaad379416afbfecc5891f2e3d8064d66663f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 94ad601daab57973c12e7a562f77d2bee720c3e15f51c7afaf97105a164ffe12
MD5 2ce1ece42aa984a9e8669c8e10b52687
BLAKE2b-256 76df0317cd7e294ba457458b82de0ffe4948e1a940380be8b315f814bd8c6c42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.9 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41f47a8e8be20e04d38655eec8da7dba769e55ae4df8259b07e325cacb0ecb7a
MD5 cad553b0040c17a45a2ca848af76e8af
BLAKE2b-256 97df964c5095e146a45a52f615b4bfcad9183511f2a7d055413cea5c7ae242ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0683883b73343a4b1a88b011341f44a2689ad8cceab181890543b41b107605f4
MD5 d2e1ff4076322edff860546e6f774486
BLAKE2b-256 2d67f8c52ce210a6146a3cc775f4734d337c30245740fe356432f579baa0186b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7622c4665f8c6cfc80fb4983446a1a7c0021bac609f415f10c5cbecba50f69e3
MD5 2f2415f58939db9dba7a035f38406983
BLAKE2b-256 50971f1141652f5cb3d74b60db65c1e94555267eacf0049ead47c5e6a00ca570

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5b7802d58dfea9537d592fe5c82d3415b8ed97bf88aacf8f570184d291951677
MD5 f56936216b52c931e76c9e5e03580785
BLAKE2b-256 279b62c7e9dd8f914a2abcaafc901e66bfd078322f255c29b40d8a22a259500b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.9 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d0f8684416924a5d616ad7bb85d89407816337d04fa2e227cd8a5cca6eb475a
MD5 0d0d9d8b8ba0d902fb9007ed54ea0d9a
BLAKE2b-256 f76fb0fd0e3563621514212393a905785523544054b9295186c5482066328ddd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f3b22d9a1fc485acb1cfb93d5c67e8672bd98a1abd85909033a3154c5cfdecb
MD5 54fba5a41641b8cc72e2d7f61f9a4985
BLAKE2b-256 42a70dfd08392f5b2feb0dee6c0a32535b892ba7bbdcd3c1b3f7e537f3702e25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 880cec6423d72828d89a95b345d4d3076454f789bf5ce213b7096f33274d2e37
MD5 9ba3d49903c6dfa6977490858fc38fa0
BLAKE2b-256 49fcafc82812be26ee27547948640f6bf2040c35742e3f5238f66b4e3ee03389

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ae4d38ed3c28f4ff8c71e92739195ea4b6adbc757eb4387a7831402891afc0dd
MD5 5816bfdd76605c518c6f44fd4ef8043f
BLAKE2b-256 355fb0574569ca3c4db5a9f02a3fb151c2272b951387bc9c104df6bb99bfd933

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.0 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a6d5f140fb6023a6b83c4b9da4289d2df317d7a19021562e6f01885a6b30340
MD5 d4597440eabfb86488000d973ac147ba
BLAKE2b-256 8bc681a28794e88f03a8a227972375da2f32cfef13f86dc945ad867b396fc85b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3cf9d84c334606ddbb3991bdb9e9d23f7ef57ddb3f486090dc3f2d80bb39ed3b
MD5 f642b4b096d4b6ce64148bd7cc123384
BLAKE2b-256 118e8c3c95884278067e990fc2e70ba56b704836df4ebe0595145e6a5d9e6bd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 028201d795aaa0421c25f45c49b92b3223df85c216cd003bba80001b2a67fb0b
MD5 6eaec18a918d34d3fe85c506d8fedf63
BLAKE2b-256 dadc5a43a06a5aee074c3143fd6347aea684d4b228e38c33c02bb0d1b4a58e61

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

0.10.0

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

This release

0.5.0 This release

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