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.14.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.14.0-cp313-cp313-win_amd64.whl (16.0 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.14.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.14.0-cp313-cp313-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.14.0-cp312-cp312-win_amd64.whl (16.0 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.14.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.14.0-cp312-cp312-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

starweaver-0.14.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.14.0-cp311-cp311-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0.tar.gz
Algorithm Hash digest
SHA256 2356cd29c6968682e08492ff2e0881f3f84ce6c470f60e8e28adec424b8ac27f
MD5 f6118f83204b47e5dc7e3820f73421e4
BLAKE2b-256 4d7a806fcd2e19bad8de4e37e170af5d185a4cdd9f4c882e2053771bc0d64070

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 16.0 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.14.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 42825bbf7e13048fef134f535edfb1a43d473976a0954e17f6f5c891e298750b
MD5 b114c286495eee579c198c86ccc98e85
BLAKE2b-256 218d40c44a042e5c8ff8ed9efedd79ce6eac9b4eb7f32be0882c9865c79e6dd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b681c7db3e934859a0ee9f71726d10ef9aafb1d71c8578eaa1bcb028c8cf0ecc
MD5 5010e6431f8d0076a715f6123c6d6721
BLAKE2b-256 34bde0e7c72d97ce20a5b89737396cb978123ca6d37315149598902acf66e08c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f0998e4e735c0562afd7c2ce545f1868811de91c2ae27fe045957de71bf8e71
MD5 3065e1c1b70d4e5e3d3037117b006974
BLAKE2b-256 1f5f498f005ad02cd8e7bb3f18ba6c9b8e531e89c20b9eacb1e0555e29d2cf8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.6 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.14.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2feb149f2389828aba4d45478c7e080b95e1739e57413abd5fe2265ddc5d4c55
MD5 537e873f4d807813eeeab77fad4d125c
BLAKE2b-256 be62cbb8ac4af155d9e511719525d609c196494ccf7373b88f268fe581eb588b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 16.0 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.14.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a34891f6d8f73f215a17a0ceb6a52974a1cf59f77cafc7b80011b22cb7aacb54
MD5 653acddd42bafacb1e54a1c2c927f222
BLAKE2b-256 e7d9865cef06b239b5e4a1296f5158e8ca2c6756413409db79cab0986faf0f0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ec80c76f1bee8426e5ec41e307a435e034390b8b51f8bc6523062aa4289d267
MD5 9ededa3c402989a98ae9c6f296a878ce
BLAKE2b-256 943eb1c91d4057ea994a08a785a36d33ab6df986ddc88a6e28e468edb316ccf2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5c54662b64c2a7dfdd6f5e45673da113debce093c1af0cbc14899e77d888083
MD5 d59ae96ad713e6a1ce27b027a7a72fb5
BLAKE2b-256 d90571214988a2d8b294ca6184af3dd82427ae977bff272808d032d41198c835

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.6 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.14.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bf0c7838c4def3ca8914c75d4b61cbfc6097cefd2021585f8142682a212cb357
MD5 c24a4299e8c55f0f987cee44238a5337
BLAKE2b-256 74fbb01c9041b35188c9cfb8d06f9350e8188620be9cd009d9faaeea49678f5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9b18dadda238d474730bc8274e01a13cbcf3b19f994b78265b9d6ead8a2aeade
MD5 a781ce38d43ddfb0ed3f39ded6ca2d97
BLAKE2b-256 1b1dd7fef0b26e44498a5141e9f0ce7af9a02fedb388ad0e3c7b50b8fd0c6440

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d322923700bd4016d3d0f8b62c57724d5b5d99dae784afef1be41e84d530f51
MD5 e1a76786f0581a9c63fb538c33e06307
BLAKE2b-256 bb689f97050b0f2cbd9ea9753316bd4a6913ec4526a2326d100d4234d6072cbe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.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.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a746eb089d5523dbec0cac010710ddda9594e9860b1fd035e295604624a46494
MD5 2431bcc47e088aa1ad1903fc56bbdc7e
BLAKE2b-256 6d70825319f825b4d0daae6e4597937ef9ab0f421b7db39399454d2bcd6e00cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.6 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.14.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ced3e5a9a89823d6d8366064a0577a52d92ec0d99084e985abbfa7197d8050dc
MD5 93951146af4e457e4505a288ce9b8483
BLAKE2b-256 debb6c712336f0ad09322e109d7b0791f4278aa736084fd74828b8ebd86bb2e5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.15.0

13 files

This release

0.14.0 This release

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

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