Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SoyaOS

soyaos

Official Python SDK for SoyaOS. Pure-Python, no required runtime dependencies, works on CPython 3.10+ and PyPy.

Install

pip install soyaos
# or, with uv
uv add soyaos

Two clients

from soyaos import SoyaOSClient, ControlClient
from soyaos.openai_compat import ChatCompletionRequest, ChatMessage

# 1) Talk to soya:* virtual models (OpenAI-compatible surface).
ai = SoyaOSClient(
    base_url="https://api.soyaos.ai/v1",
    api_key="sk-...",
)

resp = ai.chat.completions.create(
    ChatCompletionRequest(
        model="soya:echo",
        messages=[ChatMessage(role="user", content="hello")],
    )
)

# 2) Drive the control plane (Agents, keys, Scope events).
ctl = ControlClient(
    base_url="https://api.soyaos.ai",
    api_key="sk-...",
)
agents = ctl.agents.list()

There is also an async variant: from soyaos import AsyncSoyaOSClient.

Because SoyaOS speaks the OpenAI HTTP wire format, you can also point the official openai Python package at it. This SDK exists for callers who want typed access to SoyaOS-specific metadata such as soya_trace_id.

中文 Quickstart

soyaos 是 SoyaOS 的官方 Python SDK,纯 Python 实现,零运行时依赖:

pip install soyaos
from soyaos import SoyaOSClient
from soyaos.openai_compat import ChatCompletionRequest, ChatMessage

client = SoyaOSClient(
    base_url="https://api.soyaos.ai/v1",
    api_key="sk-xxx",
)

resp = client.chat.completions.create(
    ChatCompletionRequest(
        model="soya:echo",
        messages=[ChatMessage(role="user", content="你好")],
    )
)
print(resp.choices[0].message.content)

异步用户改用 AsyncSoyaOSClient;ControlClient 用来管理 Agent / Key / 订阅 Scope 事件。0.1.0a0 仅含类型签名,实际 RPC 在 0.1.0a1 接通。

Development

uv sync --all-extras
uv run ruff check .
uv run mypy
uv run pytest

Release & publish

PyPI publishing is automated by .github/workflows/publish-pypi.yml. To cut a release:

  1. Bump project.version in pyproject.toml (PEP 440) and update CHANGELOG.md.
  2. Commit, tag vX.Y.Z (must match project.version), and push the tag.
  3. Create a GitHub Release from the tag. Publishing the release triggers the workflow, which builds an sdist + wheel, verifies the tag/pyproject versions match, and uploads to PyPI via Trusted Publishing (OIDC). No long-lived PyPI token is stored in the repository.

The first release of this package is the placeholder 0.0.0.dev0, published to reserve the soyaos name on PyPI (see APP-433). Real SDK releases start at 0.1.0a0; pip install soyaos resolves to the highest non-pre-release version, so the dev0 placeholder does not block normal installs.

Status

0.1.0a0 ships types + signatures only. Calls raise NotImplementedError. Real RPCs land in 0.1.0a1 — see CHANGELOG.md.

License

MIT — © 2026 SoyaOS Contributors.

Metadata

Release files for soyaos 0.0.0.dev3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soyaos 0.0.0.dev3
File Size Uploaded Provenance Actions
soyaos-0.0.0.dev3.tar.gz 6.1 kB With provenance Details for soyaos-0.0.0.dev3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for soyaos 0.0.0.dev3
File Interpreter ABI Platform Actions
soyaos-0.0.0.dev3-py3-none-any.whl Python 3 none any Details for soyaos-0.0.0.dev3-py3-none-any.whl

Total release size: 13.1 kB

Release files / soyaos-0.0.0.dev3.tar.gz

Download URL soyaos-0.0.0.dev3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fabde89519a303c2a7136071ec56351a2bbff26be30f2a50b167a28e0ec37a94
BLAKE2b-256 checksum
How to use checksums
e851bdac0078060f3d48d9be2b8c5f4954f58c405852878b740cc4ece9268a76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / soyaos-0.0.0.dev3-py3-none-any.whl

Download URL soyaos-0.0.0.dev3-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e79311fce704ec04da15d40b69b1cf0026450825a64f1ab4fdaaa6d9aabc48b
BLAKE2b-256 checksum
How to use checksums
bdc718bf84396d61010d669354f12b2f501d16785f09171c377a2894f81f2ddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for soyaos 0.0.0.dev3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for soyaos-0.0.0.dev3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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