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.5.1.tar.gz (990.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

starweaver-0.5.1-cp313-cp313-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.13Windows x86-64

starweaver-0.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

starweaver-0.5.1-cp313-cp313-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

starweaver-0.5.1-cp313-cp313-macosx_10_12_x86_64.whl (13.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

starweaver-0.5.1-cp312-cp312-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.12Windows x86-64

starweaver-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

starweaver-0.5.1-cp312-cp312-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

starweaver-0.5.1-cp312-cp312-macosx_10_12_x86_64.whl (13.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

starweaver-0.5.1-cp311-cp311-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.11Windows x86-64

starweaver-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

starweaver-0.5.1-cp311-cp311-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

starweaver-0.5.1-cp311-cp311-macosx_10_12_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: starweaver-0.5.1.tar.gz
  • Upload date:
  • Size: 990.0 kB
  • 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.5.1.tar.gz
Algorithm Hash digest
SHA256 efc8f2e8656bfe2e8186f7ee67a766b8d72c0fd152ee8a662832cdf63dfe9d4d
MD5 102b2b34b738b3886c69b932105fb289
BLAKE2b-256 c6eb3ee7faab76879b5bbe0a599a3d3a2b71f4cd191d16f5b5fd2c800c258bde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.9 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.5.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8cdfebd2cafef5347af2512c3e9668dc8c51337f67c09d8ce41a4622b9c19e5c
MD5 da0104456821df1c688358fde875609f
BLAKE2b-256 55bd973b2171e8842168ccaefa5794c54721c66a550eb5a448df938c07619ff2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.0 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.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86c4ef50e372f93315255ae38869b8491dd46aaac6a721d3d8400bf680b44684
MD5 92c59a537e87eab8239413835ff67d78
BLAKE2b-256 1c7dc8032b249438d227b661aa0ce6fc7db08826b94104d3d434f437e7803930

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 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.5.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d92acc7e74f5d1ae5507144998bc185c6b853b9c065723e3c9538a87c0dfd93a
MD5 e88db5b1f4895cf6523ae4cbaa1fdf7e
BLAKE2b-256 17955465dee037b279346a370684c595bf99d0161644963c361d99c170b03222

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.4 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.5.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eadc0de3d3849a91d9530a6da31404cddacf5c763ed199b939a79e9f7a5c0711
MD5 a3d124ad500cf78bec8224d479b84780
BLAKE2b-256 cdad5e52cd30050be6aa9b9e184215f5457025b58a4361bb600f84bc4a2f0829

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.9 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.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 24ea4f3fe644ad532f2c2c038f6672628a76998ef5c7cfa60f5ced6517f45f2a
MD5 217d4293dba6a5574456e564444098ff
BLAKE2b-256 dbbc3bf99ec3399350a7e4fdd75699a84a47ef57d48af4c707eae95a7390ac86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.0 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.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5089c5a1382f806ac9214e78475a936a10a85955b6039c7b076d619c94495fbf
MD5 92c39c405c8a7e20ba9051d8043d82a0
BLAKE2b-256 869add8fd299e483666d99925e21cdf31e6129c823e6ee895142535035e3f0f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 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.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 189e24f2a03df731214aad1c69be9b7a2f6f03ac9c741a8bdc6647445a2aa964
MD5 e94a03353cb2baa7ea71a58364e39844
BLAKE2b-256 7c6e9703dece4b4ef4abad75691b3fd527913f372f1852a3265056f14d1da850

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.4 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.5.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 78a51c41f510dd43cec98f1a816e6510f3481a118e3be964d150c0d2d28f61fd
MD5 3ac27f0a2e585be9406f3719010e8ef0
BLAKE2b-256 e2658cf5077c5ecf6884c722b4551fdb035c118e862b9463a811e16c31b36077

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 12.9 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.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 683b3392144ef3a7d25b794084aa286ced64026b656016e4767cb893b0ce8dc9
MD5 945b6433f809ef79587587b555973b3d
BLAKE2b-256 d9e21ef50055225e3ff14216a5d4e338d2e8a4864b315695f76ff5cb49114ba4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 14.0 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.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 873e8d2c10e22751ae192934147dcf4566b3e9435f671f80e3632656dedf50cd
MD5 62037b10a96d54283348bcfc0ee1b78d
BLAKE2b-256 45f90ca5b558edd25aad610554b12729b1bd4b5b6eee2f7ea0513b438f1839af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 12.8 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.5.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c29e48b6ee245cf6f9faa1a806daeb10ee09dd8c48b59586930b8707f6ec03ae
MD5 d05c5c54b59319d1c6a4056f274b7058
BLAKE2b-256 7541a1a660b83cdfc0b48948a69b31cbd26163855a397c92ab34f0f9d5e9a42b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: starweaver-0.5.1-cp311-cp311-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 13.3 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.5.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b3962d357ae6221491db4503ac00061d1c34d56fb335990f119c3c76fa33d91e
MD5 f7d90723204412d3c5999bfe68b3d5e9
BLAKE2b-256 a22f4c5d714376f60215873826a96f859717a8bc230fbd2b1a73b336efd40f3a

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

0.6.0

13 files

This release

0.5.1 This release

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