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.13.0.tar.gz (1.6 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.13.0-cp313-cp313-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.13.0-cp313-cp313-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.13.0-cp312-cp312-win_amd64.whl (15.9 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.13.0-cp312-cp312-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.13.0-cp311-cp311-win_amd64.whl (16.0 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.13.0-cp311-cp311-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.13.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0.tar.gz
Algorithm Hash digest
SHA256 116b81117e9ed87f7c06200a24cb5333aa1d52055f6d050e9a6dbd0e7826b0fb
MD5 112e271e16114e9f97f29029b576f736
BLAKE2b-256 5b79b21ca4aac1dc11a0056b32f4dde3610caba2e0a06699a4a9e5d6f0d7137a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 eb40ec3b9a7628e5f3853eb88d39f279eadbe66545bc785e505e120ddb3e91a5
MD5 8610795a9724670f711fb70c2ea9e2dd
BLAKE2b-256 c5df47808ab198e05ccbfd37943a5d72b7a665e536009e3ed59a3b4ce5eb1c89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.5 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f35ecc386f298225bb5d2f6dc82951b9d4f1f7e477c41c0566807d99a843b9f
MD5 988ecd0a75b71f1d7ccb5c505c83c871
BLAKE2b-256 6bc6e8a44820abdc739aca93a88546218480afe2ece2550879a4d6ef44f647eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c58e302c926b74d47092455153a81ae21486fcb3a68e0b03658766ea12c67830
MD5 997e8969948a447f659b898534393c6d
BLAKE2b-256 c3611ec7f03e403d6986a5698796390f6c7c946ca78f3d1728c7da4a98882c6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.5 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3c73def360d92574dea1c5f5a33d380a66137ea519c520b2ae7a495dcda2a998
MD5 09efd015bd57a68976b31b63cfa28e72
BLAKE2b-256 42e650d98b46e1f947ee13cee55db8c1dd3ec48494105cda6c286bd9da8663a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 15.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 45795a2c0752737d36769c3aecc39049ff5cf986a08be93b4f88a43543daa35e
MD5 e9f56b8494350c37dbe1ae2b093ee078
BLAKE2b-256 e9463b2d3cbd27066ab6e47472cd97293546cdf203ed7834c098c88518e98c6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.5 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da5e52ff412129278cac39bc6d4f25b8c3ef5d2f45e60cbc5f5e5e6b4ec83b9f
MD5 555656b68d15b272c501adf3e9abcbd0
BLAKE2b-256 e60fe1ebe84057b8b643f435e1017a531465a69f6be0729b5fabd4b82d79ff83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3dc9c930e32e01b179d3bcbac23e916b9cacaa3f07ebcdc061810f39c5e9355b
MD5 23e1f5462887d0e666d68e23712ef5f3
BLAKE2b-256 91841cb45fc037e89ed61bf36e805993ea551c38abb3c25215e9d1cc3b88d236

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.5 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ff4f3ff89f6727eefe2c93b9d11fafc1d7d96a67488ca98e1801c8235efcc57
MD5 c5b1061fb7dbae451e2aea964abee8ba
BLAKE2b-256 7fc004fdb67e8c3ec51df725b62b094f07c64d2e9844e2dbfe083a0be3702dcc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 16.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ac0dfadefa60b625aa9afc5bcb99267aac1cf7cf4f36fd148d4d86f0e9c9fcd7
MD5 00fe21e08a80cae5bb8af6404d49377d
BLAKE2b-256 2503dd77f11b49c9f82011992cb558732f1ad24ad64f267569954695cf17c563

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.6 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89a8496d2daedbdbcbc9cdb0a1d8536d929079df3b3e0ddf10ace70508a0ac70
MD5 ed299dda5a6d70a0511d2a0c07f503c7
BLAKE2b-256 0a591bda96903855aa11e3616ee4745f62095a3387dc2bf19348acaee944014f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 319b53116c947922df3ffc5cd322460924339b58c2a8b570194f3d5798de778c
MD5 cf8d7fcd3f3e9ca5db205d35bd454278
BLAKE2b-256 890d3ffe7902055f979ede507a554a984b0244efdadcfbce9c6830f472161117

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.5 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.13.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d7b1ceb77afcb13b1b590fadc771ebad8357aa591016cb9f13060fe5d0011731
MD5 978f20c8982f2a55d6fe7883c4d19b87
BLAKE2b-256 ff93433573de56855ffb9f9c11522939d2e07f1ff91aff218dd2856bf6a6cc14

See more details on using hashes here.

Release history Release notifications | RSS feed

0.15.0

13 files

0.14.0

13 files

This release

0.13.0 This release

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

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