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

Uploaded CPython 3.13Windows x86-64

starweaver-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

starweaver-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.15.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.15.0.tar.gz.

File metadata

  • Download URL: starweaver-0.15.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0.tar.gz
Algorithm Hash digest
SHA256 80b3a3f236aba50803c0bd1e08a347f4ee055120e0b04bc4db9f7863d36d2965
MD5 c4d8f01f0e9a661eb41e0b5533020553
BLAKE2b-256 9d21162943e498d5049963fe1b72176e18132253b408f6578d9cfff7a0c3ba79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 07f1bffb95efb5e7e0b9953a7803801d2c7f73b722b9425069bee2cbbbb346f0
MD5 b1d0ab29f16654b9b264fce05d72dd11
BLAKE2b-256 37321755c40fd175c5abdb4b0684299a346282f19d5aac4998b8cbeb57818fe7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.6 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ed492d34baf9d07668bd61c7a31d059a03c9312439b6f5bdb02db9a1d53cf7f
MD5 296397f8ddccbdb4ffbf8aef444e3de0
BLAKE2b-256 d05ce0caec83dbf435ffab1a5269139c5e22afd99e57d7ead893b7682d303e8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3193bdfec780e2a4d9aed078811d7e43399d2bb61f8a448907cf8612d2e60cea
MD5 13520382fee9262f3c4dbde996ab370f
BLAKE2b-256 e52c186c08b38cb167f658a3a95a258e3f9b398d9adefeeb744c1cc1233db601

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b3cde930521f018556e1f3caceef831c434b367230f686898446e4de5aaef35f
MD5 a1d78eb60a1ea118b8bd5d6c71442403
BLAKE2b-256 9454ab41fa42a24e09a3cbb526d3ea652131612598ea9182cc9a62b78294daff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 653efa7193cc0f8d7188e9aec5a8f9c213f2b8a642bc8dd83f3a6dac5fec67cb
MD5 a8a20c3d71c7f59aeae1b662efb0d538
BLAKE2b-256 ffd0fa47681928365689f08c7353ea6f022d54048dc866b3b7f67d09da2f7fac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.6 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 495838e17622e7ef81a4c5d02c3248c7bc9aa92cc04d34e83856bf03b88a2989
MD5 8e093736b04cb6839ab8ddd4178eb95d
BLAKE2b-256 291419c0692e9aeff2b8732c55ce240e3be0b98d06385eea8d57daac9e8607e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b38b0c9a55419d7ec7286059fdcf15316ad01ac6869f34f6ee1af00df3984414
MD5 a80695fa91bfb6d80bab54a3dc744672
BLAKE2b-256 d5f21206d8ca48026f5bb8a9feb023b8d2f868e7258d5fff96478175701c6957

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b97d656646c6277b4128c8b6fdec39e5839869850d7d09901d8f8d87bc5b6945
MD5 5a90d8a0de96d251b560cecb020c767a
BLAKE2b-256 15cb481f9d964dd4cf7dfa8fbcb06d48e047b00d5eee9e8fe4c304c9d4f660fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0a3cb454569be1d861f347c5513b242ac2a026f5d68f36101dea9b2ed64ccff4
MD5 4f13c49408d27121c17dd956650bbb6c
BLAKE2b-256 78479ce4190e14eef7ae126a4c2a872b83b0cdb1986f1479ec5df33c03c4b683

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74118f8f523ccfcaacae714474b4d3e0a49f83dcc26aa43387b1c3cb795e373c
MD5 9d68bb094a57ab8636d2a73e852b4fe7
BLAKE2b-256 45926908cc3f0225aa321cbfeb69fa32e962a9d0c95c4ae7c43e1be4bee9fdc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d4d2f4e9911e12b422f3a89d0bdd64a18af1b1321dcf1c461616e9bed876c350
MD5 20d3d5d3a5819c90794fccfb3dd69ceb
BLAKE2b-256 df2f3198044dc23a576813b4dbd8421baffe9efeba362ee9f06bfce8703c35ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.15.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.3 {"installer":{"name":"uv","version":"0.12.3","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.15.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1472d192ac589f74ad2fde4870af986e8fdedf696d85e0eba78931e5c511b9fd
MD5 6727fab6db1ea04181240d6b259af228
BLAKE2b-256 1ac93eacc176d78dbed21abdaae61b44b4bb79ce963624c90dc8b043ba2a5366

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.15.0 This release

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

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