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.8.0.tar.gz (1.3 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.8.0-cp313-cp313-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.8.0-cp313-cp313-macosx_11_0_arm64.whl (14.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.8.0-cp312-cp312-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (14.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.8.0-cp311-cp311-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (14.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.8.0-cp311-cp311-macosx_10_12_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.8.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0.tar.gz
Algorithm Hash digest
SHA256 e0ea6c0708e97eb5be7bab32e903f604564747909d5e40a5d4c4d84f735b54ec
MD5 beb4520c5633286225adcdd36bd66e17
BLAKE2b-256 e0e64c3235ec6c62991a802fb932905eb3aa67cb231fb3426228e8d3a2b27104

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e1a91db4d87d71cac99d5555ea29e135ac8d93601458999329518f41949fcf25
MD5 2ae75c4383b2c6651d5a823ad1dfb959
BLAKE2b-256 b51b1f09353ea159b31bfe9844f0c1e3bd7f73ce8bed19d275e5029d0d2b1812

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63f00a547123f0448db9475a835605b894c2724b1fd4d4213e225b320e1b1c25
MD5 feea8548deca53a9d999eae45c17753b
BLAKE2b-256 864d01f09ef770a3dca36f1b249eb77bf592083a98746d0bc357aa074551ce3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.1 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3870a40d0a8d5ab01e0fb0e28dce14f4d8ecf1e848bae8e07b0b71563f1bb225
MD5 eb2b05341b7ceb271497cc439861b705
BLAKE2b-256 9e35d524c6bf63911d18fd1dc828739cd0ba17ff39a6057d5320eee3caee412d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7f78b0716028a8f9871bf492f440cb4d1c9a87935c2124432bdfdac224fa05c1
MD5 6c4e1bc1bef8eb9c32dc5cf975294f49
BLAKE2b-256 f3bbb909ef4cf0eec683b97e0087cf85bce5f4fcab3e8a198471c5f310fcad89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2e234c5d24c8320e577816d5e3c21744beb1e27c1c6389d87c7f29d5eae71dbc
MD5 f0b3a7bffa9e83f87ec2e1cb0843c455
BLAKE2b-256 90ff69cae6d42a83d9763d62f88cc2a00a4566b85280db831b8a6cfac864a97c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c475e55063f7a466e8b86603046ae893d7b4845fd4b591747a203190b13936c5
MD5 957d1dc2c9a8c6dd2cb970dfe4e5ccd8
BLAKE2b-256 c05cd5265656a166683bee5659cd5cda1330c1e974e8bf9d7f63d110535533c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.1 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 943af5023d9dc48fda8bfe2f3f449d71c253165e489562763a57992c93eee831
MD5 ddbfbf4b50957966adc3bb832b0514e4
BLAKE2b-256 956cf95c585c0a3602a05d48a83c2304d1b0232d6fcd782d5a8d3fad63e567cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 72b28deac8734e22179786f082171b16065cf82db1622794b1ec744c780e40eb
MD5 d7533cf7e2acb17c06d392f06f8486fb
BLAKE2b-256 25ee92feae04549d2f2ac969bd47342040f08da83b128be760b2a25d2f911951

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 12c598eab72c8e2b52659f97162a9a3d32df1fc7d4339e2340eb856a76ddd62a
MD5 5e3917aa2ff5408dc5e0b977922a5c40
BLAKE2b-256 ec2a17897368b3b3cf552c69288b51ec3591c0e88b83cc75c0044b4140533261

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c30056d299ae26a1a7a9ac7ce4b8d51c8e7ac103aabe9e9eacfa8112bc06f770
MD5 4881d85a1eab1af15a836087d478e0fe
BLAKE2b-256 a89bd6a32e15edf5864a95b39a3bb584ce2d314c130c574cdf7e08a0ab95d453

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.1 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9bfa1d66e105a2ee8847eea9a801db6815d601c6241faffa720dfd0fcd4f35b
MD5 50571a52921166356da34eea51e560da
BLAKE2b-256 dbeeaa06370bb8c7c7d615e33e8df1a90a97bbcc8499de0c3ac8682114101191

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.8.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.8.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f50671228251aeb8796bd0abb9e0cacd98afbce051b3b9844cbd566c46e5b09f
MD5 5dcc586548318a79d415b70cdcaaf210
BLAKE2b-256 66ba2c866b99559c1259871adc1527a3406cc59487efd912702ed0bcbfbc3301

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

This release

0.8.0 This release

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