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.12.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.12.0-cp313-cp313-win_amd64.whl (15.4 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.12.0-cp313-cp313-macosx_11_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.12.0-cp313-cp313-macosx_10_12_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.12.0-cp312-cp312-win_amd64.whl (15.4 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.12.0-cp312-cp312-macosx_11_0_arm64.whl (14.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.12.0-cp312-cp312-macosx_10_12_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

starweaver-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.12.0-cp311-cp311-macosx_10_12_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.12.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0.tar.gz
Algorithm Hash digest
SHA256 ad2f4cdae5cb3fd0148290255b7d00a43f3d684f12eaa5b7de85643f91055c24
MD5 c87d9151d79dd072fabdbf1e867969ed
BLAKE2b-256 fa7568bd92262c08a1e3d2e4216c1f8b75734580e4e1acd0fa9e421e32432db2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 08ac40b3d2f8092798ae5b1aa0050dfc6b999da8a18290eb8ff1f4512c41c21a
MD5 128bc07fb2a3b194ba823e6e21aea83e
BLAKE2b-256 131d2d5c500ada08f64891310c0be73cc4f41f854a48e5306c60524894d4c1de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c848a3b930f4f255a5bc7086dfb3ef59e095ceaa60b850f5db613051f692964
MD5 e10233d3da1b323c4b34dd1626624117
BLAKE2b-256 9dcbce54f446027722a9a24312ef890dfa536c9b5445dcae27d5439009ce87dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b111f97bda2038630cf9a8b0ece52a6e2a628a9a9e63a4fcb07e8b17f2a6fc8
MD5 b886604b98341649f5be534163d617ad
BLAKE2b-256 7bba28c16917b9e1cdb901210b0d8f6eba7bebd171ff71f86b3ff6dd4d85b300

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.5 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e13aa123fe12b954ddcb7180b49c526829a5d11aee633eb354f3fa8837ec0283
MD5 47158ec3f8d7489db74ad8b53e261186
BLAKE2b-256 7906df39d2f0b8f94d4593b35fbdac41286a6d5b8fb3925dbc3c3d84df1b6b05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4ad6d1f1122ce5610a5a0910acfa41b1cd1b10c559c495675f0d4854d74c22c4
MD5 7156cb56948550bbb306b9268d495a4a
BLAKE2b-256 f5324c207e8bcd220e9c104bc8cdeeaf48a4cfe0d4ea011d32a0cc9b30b79505

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d8a3c025d66fcf26aee4d96250132ed5e006af3b06489487a2453c1981da175
MD5 e134275d7e9f7ead699e2fc3e5ec0368
BLAKE2b-256 5e58b10f97949368abe3962774743ba2fc6f33851ae3b28da95e4e40dc1f1e92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1265e568763c40b50ee79a81f05b34c93b75c48d060e8a9e8e32ef61bc3190b2
MD5 aca6a5ac686c1d97ceb3219494932485
BLAKE2b-256 cae8e1705ea4a90024ea38ab8247b24cceee9aea0743428e56ca8540bee1f15e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.5 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2616286513834c7ed9e685fe70904c9c7b5c7faf5dfae7004aed08c63e11f6de
MD5 2d8f8216e6ed5f0cbf5ef21edca9f6f3
BLAKE2b-256 02ad7b2fae6263c1c41750f05b580fcda1f67d19f116ea345cccaf7c0c300818

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.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.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c6c6c6d2ba76b37d84ef218f86b72d32f217c4b1d93f47abc7f1cfc7ab6b57f4
MD5 b44073dfbe01de89eec8e2adba571836
BLAKE2b-256 9d8110317368d85ae89908b5c32d1523adf1f7c54bac834af066191bd0746c47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce58d175d64d9e4f3300fac1744bff759c6470aedf3a58774fe01b432adc2005
MD5 622b4d73114de6787a8419d43e1bba9b
BLAKE2b-256 19eb75a4508dd9f3e73ac6a2993ba5324ae8c70510687bcab885537bee1ebb21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.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.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c98e177fb05bfcd15ef28271bfd453432dc411d5e131465662805a7ec91918e
MD5 df0bef3b7de5aaed043666215f27c088
BLAKE2b-256 3a90f7a42638acf050e7e081c40f6703cff2b944c29850b2e7928d5993b383bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.12.0-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 15.4 MB
  • Tags: CPython 3.11, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.12.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f5bf51fc879e4226044797bcefdadc277788e52526a683df08c53d5bf97fcb69
MD5 ef1abf0cd010a996b9b1be1d63998616
BLAKE2b-256 c52e33ae16c0e433c1e247628c6fe414bb72ab262f917a8dfd45598a2919c3bf

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

This release

0.12.0 This release

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