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.6.0.tar.gz (1.0 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.6.0-cp313-cp313-win_amd64.whl (12.8 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (12.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl (12.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.6.0-cp312-cp312-win_amd64.whl (12.8 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (12.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl (12.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.6.0-cp311-cp311-win_amd64.whl (12.8 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (12.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl (12.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.6.0.tar.gz
  • Upload date:
  • Size: 1.0 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.6.0.tar.gz
Algorithm Hash digest
SHA256 233c3d58c8c783f05a1e3702ec050cca81880f883f4bad51f960daa9a8370139
MD5 4a573ff20fd02448ae1e80c37daf31c1
BLAKE2b-256 28a889c0cac9bbbf266a170efcfbbef0c90f710fd4c3f66d1bfb36d865378add

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6312a57effd95d87861d58754c927fc06f3a414b58eb2caa6787eb1f8962ef18
MD5 12a2ecaa0e2069d8960f0631cb88e8d2
BLAKE2b-256 f8fb7d54c335c36b43a6f6c89b371bf68034f35a0bab86e3b9f5b36af3641f73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.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.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a79225dd8a04f729d1b65240413ded91c6e8ced117fc72adf78954339504844
MD5 aaded2c0d0bd117bd16469a65572e2f2
BLAKE2b-256 ad9de41b0f9fc071016b8d247b137249a301428c9a853dce41ce92b46243ea8e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.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.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85e0a6759d56d4d7c83b6ee12a81fa833d68508839441d68ca3d6f440272ee04
MD5 0df17ab2c8f725fe8913df26838116a9
BLAKE2b-256 d893d7eab9b439186c70219ae6283e0c27155fd8a7a7c69a8060cd811ad9946d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 12.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.6.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9b210aa35b505e0dabe54c55934d739199131fc4d069d16ad9a79913a100fafe
MD5 475bfbc23cb8698a16e6085c992b6621
BLAKE2b-256 df90bc943e96c6a7599175c6890a0be61e6f9068949b8995dfccd56ab46d8c1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 18fb25cd21c5aa565dcb77d3d33cc188aa2c4a4bbbce3e84cff1d2c47177dff4
MD5 c43119baee57699904dca31916005b59
BLAKE2b-256 ac83c7214f91649152e4d64ba379ca5ca9bbef5742cfc382fb45f39acd0a1d23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.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.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 446162a7563a65b8434bfaa1689a7e08c65b2cfd43a3548492f5ceacfe750397
MD5 679ff47d4a7dcfabdb701de1bfe04ca1
BLAKE2b-256 1276365b9b8dc34c510b8cea7f939e63a35a94f214f1ac1a789e474db8b554c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.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.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fde3864ec2c7bfd1b15f0cc3cddd8b6ec383d8bfa9bf9be0f226e8445118ea26
MD5 2dd0f6178d86c17ca6b3de10cd68d128
BLAKE2b-256 80fcf34a7bbcd21ca31452a1c54787237668ca8bd1dbfe12ca69b90336b41bc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 12.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.6.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ee4c1d908eb6193122d0250fddcc35986069c30fcd6a6a4e31e90a2f27d65d12
MD5 3bab12b1425c9f0f318c2c626166e0ab
BLAKE2b-256 16c8704836779e98809d7b8cd4fcae81d5ce4a366af6144ac6143c0c7993e620

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 12.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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b7965558247477a4069054a49bf8624cd76bb80b54481e8e0f0dcfd2361013d4
MD5 aaf8a64dd2d7bd554f303139b6e74d86
BLAKE2b-256 aff2ba6cb221470555594f2b243b0a1c61a67abf16b0da05e523c21e0fcbff42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.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.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 22823d3476a47d623598008f8ea06431f278c81a02a944f768d22dc3459b6cc5
MD5 32c10040d31d2f818efa47846c895d47
BLAKE2b-256 3908757f8af31005661b6f9365c44756eb98353f4a9f75a6036e966a303a7ffa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.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.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a71e84e6a4cfc5649e555377a99e893adcd226ca906d5656bc4e7b82217cd7f9
MD5 438c24acc0b888caf31c2284dae488b7
BLAKE2b-256 4d91675c15f2eee2fc25f7a9f421d3fc5b6b357f63ced25694e7e535ef9261d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 12.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.6.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 81896197afc2f1435eb73ffddbef92c8eb1fdb7aa6c8d667af91ecb469dab20c
MD5 8d726b6825a43c308967b2fc51ef907d
BLAKE2b-256 f95dbead0dde564815887b61717da3be9952a4f7593c163caadb53fb637d0d8d

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

0.7.0

13 files

This release

0.6.0 This release

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