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.7.0.tar.gz (1.1 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.7.0-cp313-cp313-win_amd64.whl (13.8 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.7.0-cp313-cp313-macosx_11_0_arm64.whl (13.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.7.0-cp313-cp313-macosx_10_12_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.7.0-cp312-cp312-win_amd64.whl (13.8 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.7.0-cp312-cp312-macosx_11_0_arm64.whl (13.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.7.0-cp311-cp311-win_amd64.whl (13.8 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.7.0-cp311-cp311-macosx_11_0_arm64.whl (13.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.7.0-cp311-cp311-macosx_10_12_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.7.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • 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.7.0.tar.gz
Algorithm Hash digest
SHA256 b9162085f073600b4bb3bd269bb33a447de2eb298c95e2369ae7780b586792c2
MD5 1a893802779439ae3fb66c36cdb9caa5
BLAKE2b-256 35cfd05b3447bd8c1cacb82a4b6b18547c08503b5f0ebc78d02e54b38e53a6b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 13.8 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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 402362b1aebc2b82f92c4db3d1e7ebdcc087cb9c3b60d82d3c11a8bf491b89b5
MD5 5b12a933a7325977bdaeaa3979c304a4
BLAKE2b-256 f6a2f9d34feb37a40880de1e4a307741780853ee0fac5e58fc61d451c2ac1b5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.7 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.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ada409e0421d922b1219a7bef2d5f61ef8921d3d9784a00edb9bb6d091507642
MD5 53f87e5121a0dc7ac8897fe590ef3719
BLAKE2b-256 daee7bd82fb168066d0825d2ca8751d7b4c82660bc0fe1a00bdd3ef390c72841

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 13.5 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.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46798a3d0d107f70f0db89d661ba3ded6dc69c23d03c21b4fd630e9a61774be5
MD5 28c89d3f86f6dc95a631172f8e21bae3
BLAKE2b-256 9f1cd63fb7d2066e7752fe89eeedb1c82984fc7f75959568fd42ef0ad6e2dc2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.9 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.7.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6ddac3044ea728f0e02ffdac9ff459080f79e3c1e79269dbf8956ee259fb6731
MD5 0d182c9ac9bbab68aaab124f225fb0a4
BLAKE2b-256 8866b621538d7bce0b481a57100bcf2edc5789188eaf577df3604aec127e96e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 13.8 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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0bbdf6bf6c4141f6edcefa12ae4581ea0ffa64c1ac38c9c2f2b865d8be84fe22
MD5 cba2ec0072c9765dd238318eff36c014
BLAKE2b-256 99f08587cc16c4968565fc700fed47428d55e78841c2326b0e1b52e81e65460a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.7 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.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff136d8221d3266a8796f9f634bcdbc4c763476816f038879ebd6dd7a3e87b5f
MD5 6f410270e0ce8e510b52628b77759f50
BLAKE2b-256 d29e315f8ffab7cf41755602070f0b95882e438407f2cfaeebb0bfdf2b0a3f87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 13.5 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.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 201c073dd94059d805261be18940e7b5521a97f3e9cefbf77c1d59153e17e786
MD5 0e400b6e6231e8a52407e46b95a0d9f9
BLAKE2b-256 802c7ca76bcbc8afcbcd3b6972289d887ffaa48694ec378c489fec75812598de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.9 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.7.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d4f832192fbdb5712826ed1f82da1f31374691ef64f8683e88d0dbd5ba2c0989
MD5 5295a845b9bd78d0ab42d891f157df99
BLAKE2b-256 c709ae785aa467ec2a3b1c7ba601e8be54277ed709e8f504e829b6b88e7f587a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 13.8 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.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c9082044d26c456c9a1f5d57755531cf0309fe9fbb26155f3c3eb1b3f700720a
MD5 2928fa9c6a3893ea93ad531a3a1667fe
BLAKE2b-256 7e780fc79d63516042ee41f4bba938d92659d48b56f651b7d9fe3eaaac0cf1da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.7 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.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41f80e23d6d5c3efb8a64ba47002e7237fcb9954b3aaf753b230e669bbf1d30e
MD5 c45ee471ec3b783b355d67d53dfdd371
BLAKE2b-256 533f98e0908fd9cbfd8bab5d2e20cccb699f21ac486b4568790979b4ac6e324d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 13.5 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.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fda1015af515f652a357a7100d6f0f07ca25896cd3992e08f2e9c3a3316ca689
MD5 5d4e45657042f586149910c1f7ddf953
BLAKE2b-256 eaaa361aeb9dd09b4d0b2787d04036c8b443499456bc2b2f972bd7e94385d720

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.7.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.9 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.7.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cf1b05db6c78d1c91c12c296c1b015140b23fced26b693e78c51979ca51f7a64
MD5 84c28c26bce5193e67ed3a445118c3bc
BLAKE2b-256 fc58f50e4be361788055bb1de35ecae385e09f6ac4f91cbb6a27c5cff8bcf160

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

This release

0.7.0 This release

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