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.11.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.11.0-cp313-cp313-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.11.0-cp313-cp313-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.11.0-cp313-cp313-macosx_10_12_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.11.0-cp312-cp312-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.11.0-cp312-cp312-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.11.0-cp312-cp312-macosx_10_12_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.11.0-cp311-cp311-win_amd64.whl (15.4 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.11.0-cp311-cp311-macosx_11_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.11.0-cp311-cp311-macosx_10_12_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.11.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0.tar.gz
Algorithm Hash digest
SHA256 4394b399c85141d85cd177a0f78ac47a244bada1ac5c2dd4506698342f20d388
MD5 6d5b31f80dd5f2fd8bd6f3831f27e734
BLAKE2b-256 721f85da30c3cda53553676289cdb0492efb661bbec1a1128158a3fd7d99c8a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 97ad284d101b0fc103af900d82effdaca0a763ac3f4ed910cdc4409605960da6
MD5 33058729835f19751593c873c07d7d61
BLAKE2b-256 a8bfc61cc263bfebae5b27cc6bf7be91f8ed7899c4b6d107454f910ce8621de8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 766550f260b579eaf87457c79aec9c25a3138f2bb9e2aa4c4f49fbd03f97f716
MD5 bd359eeb809e6c32f2901ab679637b98
BLAKE2b-256 ffe58a3a46d977274350f014ebbf7f2504d7936838460c089a12e043f4e484f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.8 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eedd8c099e4b227632f4a9e5c9e29c202d0e8887f62d4cc406b6ada49126825a
MD5 3369072e6a76f69c453bae296b4978c6
BLAKE2b-256 a28c9977f1ca912aa0a52747f60019cb75e17faefb1b1b6784fdfedb8a783b31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 72d0bbdb36f124f609bd495515d1bfea06b98e9f6528481ca435dab092be27de
MD5 3c30f3518c4c45d616d87de189148ff4
BLAKE2b-256 4ef36b32fa6f94f0a5b5ff28fff5df22832ebc37da594de8080ff8e0cb8cdc3a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ef65c2c61b1a527c1f84c712abcd8f7d6d80830f26e406eca9bd30bccc056974
MD5 021911f856cd0a2ff597c47204e3c6ea
BLAKE2b-256 bd96be99e40ac04667c2dd63f30f3121c8b1552700d29aec43be7390b6eb2f7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a2d23f8ddbd3ed6e821d3e43ce017c7cbe8cbd2f244e4fde045a497a279e008b
MD5 ce7538f28ddd640916e37c1ee2831d19
BLAKE2b-256 54a492f0d5d578fa856d6f80132374347dd54ab7e6269145d17ef580fe87d368

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.8 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 062c08f63703db56262903eab6da6d252b2ff2b6ca8831956e64d721ad8ded8f
MD5 c17aec2c3ceb5890aa45c4684a2a0eb8
BLAKE2b-256 e2defd5d011bd5f0055fe505722fd646eae5fac9920822a50ddd1829f0b42a2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b8344e90e78e66ca15250aff4491ea8320336b5366eb1f23056348aa93d3adc
MD5 cb53402572c45d6c79c0e3829b1c4814
BLAKE2b-256 f9b1e5d9aeddb62be13906b8e2d269e743a9dd7fc8088ab31561c7466d0bfbce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a81037461eb1c368fb5412c8462610ab88d07ed7724fee66692dbc351c454056
MD5 5dc5e669eb03964747f3503521a21abd
BLAKE2b-256 300e5ac574f33819a89d680a4e4b31e8dd2261ffe3aa18333ebfb81cdaff36c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58d3c7f4c8796af89e8b85cd4e380fd92834f75220d05ed4c5d4e5cb658d5efb
MD5 f886241af2848a8763b63cb00e6b8aba
BLAKE2b-256 de9da42534f2b7cfcab31ba2ad85aacc848bf888433a25501c96aa1a787a864e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 def03ec9ec6f459288c98924ed1589af12c7982ecfccfbd1acc013acab0109e8
MD5 a02dd8190e21c86d1020bc8010327426
BLAKE2b-256 4f02b045f6bf7c2884bbb4f1ce1d98d1b98ca01aafc31d13eadadeac8895b27a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.11.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.11.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 abb5ce81a3389c3d92bbbc1ba160816997a02199366b62b6049b1f9a247481d8
MD5 96fb3f5eb1115c582eee65cfd8855392
BLAKE2b-256 b0f0d7ab9c55581faf514d96a358d945e68823df32e2a20cdabb4806ef1d0669

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

This release

0.11.0 This release

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