Skip to main content

xiaoguai (Python wrapper)

pip install xiaoguai — a thin Python launcher that bundles the Rust xiaoguai CLI binary inside a platform-specific wheel.

On Debian 12 / Ubuntu 24 and other PEP 668 "externally-managed" systems, pip install into the system Python is blocked. Use pipx instead: sudo apt install -y pipx && pipx ensurepath && pipx install xiaoguai.

After install:

xiaoguai --help
xiaoguai chat --mock --prompt "hello"
xiaoguai doctor    # self-check: database / providers / Ollama / port

To keep xiaoguai serve running in the background across reboots: xiaoguai service install (systemd on Linux — needs sudo; a per-user launchd agent on macOS — no root).

The console script forwards every argument to the bundled native binary. There is no Python agent logic in this package — it exists so pip users have an install path alongside Cargo, Homebrew, and the standalone tarball.

Supported platforms

The CI matrix produces wheels for:

Target triple Wheel tag (approx.)
aarch64-apple-darwin macosx_11_0_arm64
x86_64-apple-darwin macosx_10_12_x86_64
x86_64-unknown-linux-gnu manylinux_2_28_x86_64
aarch64-unknown-linux-gnu manylinux_2_28_aarch64

Other platforms (Alpine / musl, Windows, FreeBSD) are out of scope. Build from source instead (needs Rust 1.94 or newer):

cargo install --path crates/xiaoguai-cli

Offline hosts: the wheel bundles the native binary, so it installs without network on the target. Download it on a connected machine and carry it over:

pip download xiaoguai --no-deps --only-binary=:all: \
  --platform manylinux_2_28_x86_64 --python-version 3.12 -d ./offline
# transfer ./offline, then on the air-gapped host:
pip install --no-index ./offline/xiaoguai-*.whl

For the systemd/package route and the SEC-01 credential step, see Offline / air-gapped install.

HTTP client (wave-3)

pip install 'xiaoguai[client]' — adds xiaoguai.client.XiaoguaiClient, a synchronous HTTP client for the xiaoguai-api REST server (requires httpx>=0.25).

Note: the client snippets below predate the single-user pivot (DEC-033). The live API now serves on :7600 with optional HTTP Basic auth and no tenant scoping. The bundled binary launcher above is the supported path; treat these examples as illustrative pending a client refresh.

Covered endpoints (v1.2.x)

Domain Methods
HotL list_hotl_policies, create_hotl_policy, delete_hotl_policy
Outcomes record_outcome, outcomes_summary, outcomes_timeseries
Skills list_skill_catalog, list_installed_skills, install_skill, uninstall_skill

Quick start

from xiaoguai.client import XiaoguaiClient

with XiaoguaiClient("http://localhost:7600", token="my-bearer-token") as c:
    # HotL — boundary policy admin
    policy = c.create_hotl_policy(
        tenant_id="my-tenant-uuid",
        scope="llm_call",
        window_seconds=3600,
        max_count=100,
        escalate_to="ops@example.com",
    )
    policies = c.list_hotl_policies(tenant_id="my-tenant-uuid", scope="llm_call")
    c.delete_hotl_policy(policy.id)

    # Outcomes — ROI telemetry
    c.record_outcome(
        tenant_id="my-tenant",
        agent_name="sales-bot",
        kind="revenue_usd",
        value=1500.0,
        description="Closed enterprise deal",
    )
    summary = c.outcomes_summary(tenant_id="my-tenant", range="7d")
    ts = c.outcomes_timeseries(tenant_id="my-tenant", range="30d", kind="hours_saved")

    # Skills — pack marketplace
    catalog = c.list_skill_catalog()
    pack = c.install_skill(tenant_id="my-tenant", pack_slug="rag-legal")
    installed = c.list_installed_skills(tenant_id="my-tenant")
    c.uninstall_skill(pack.id)

Error handling

from xiaoguai.client import (
    XiaoguaiNotFoundError,
    XiaoguaiValidationError,
    XiaoguaiConflictError,
)

try:
    c.install_skill(tenant_id="t1", pack_slug="rag-legal")
except XiaoguaiConflictError:
    print("already installed")
except XiaoguaiNotFoundError:
    print("unknown pack slug")

Typed models

HotlPolicy, HotlVerdict, OutcomeRecord, OutcomeSummary, OutcomeTimeseries, InstalledSkillPack, SkillPackEntry — all frozen dataclasses with from_dict class methods.

Troubleshooting

If xiaoguai after a fresh install prints "native binary not bundled", the wheel matched on architecture but its package data is empty (rare — usually an sdist install rather than a wheel). Set XIAOGUAI_PY_DEBUG=1 to see the resolution path the launcher tried.

Documentation

Full documentation, configuration, and architecture notes live in the upstream repository — see the main README.

License

Apache-2.0. Same license as the upstream Rust project.

Metadata

Release files for xiaoguai 1.35.0

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

Built distributions (wheels)

Table of built distributions (wheels) for xiaoguai 1.35.0
File Actions
xiaoguai-1.35.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for xiaoguai-1.35.0-py3-none-manylinux_2_28_x86_64.whl
xiaoguai-1.35.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for xiaoguai-1.35.0-py3-none-manylinux_2_28_aarch64.whl
xiaoguai-1.35.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for xiaoguai-1.35.0-py3-none-macosx_11_0_x86_64.whl
xiaoguai-1.35.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for xiaoguai-1.35.0-py3-none-macosx_11_0_arm64.whl

Total release size: 37.9 MB

Release files / xiaoguai-1.35.0-py3-none-manylinux_2_28_x86_64.whl

Download URL xiaoguai-1.35.0-py3-none-manylinux_2_28_x86_64.whl
Size 10.1 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
198692bf032308013f1b2a3f350af8c76d255901ac523ce1ad69befe5d6831b5
BLAKE2b-256 checksum
How to use checksums
cd705438405681d48f3ceff752f836bba7958aa11639a7372e340474fa5129b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / xiaoguai-1.35.0-py3-none-manylinux_2_28_aarch64.whl

Download URL xiaoguai-1.35.0-py3-none-manylinux_2_28_aarch64.whl
Size 9.3 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
20e954c395afdbfadaaf47727c04b29c90d2bce108cc1c868189316e590d0c05
BLAKE2b-256 checksum
How to use checksums
0b6ee318092955fa77ff7dec44e0691e9a50ab6e3a002383a3c03e71e973411a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / xiaoguai-1.35.0-py3-none-macosx_11_0_x86_64.whl

Download URL xiaoguai-1.35.0-py3-none-macosx_11_0_x86_64.whl
Size 9.7 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
4320295044562b74bb16f9f3e1e5f6ac3931438923c1e71a032961432f9db203
BLAKE2b-256 checksum
How to use checksums
d0bc03f8204a6fb099966edd5590ae6ec0bc31bc36dfb1c9e700fae78617f899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / xiaoguai-1.35.0-py3-none-macosx_11_0_arm64.whl

Download URL xiaoguai-1.35.0-py3-none-macosx_11_0_arm64.whl
Size 8.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
61a257d3499b61fd0d206cbc951cd313e2b6a48c106abbcaf0ca4d6d6290c41d
BLAKE2b-256 checksum
How to use checksums
084449bfbf507c32db14a8ab26ed54365f5ba69df21d325d891d9cdcfe90051e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for xiaoguai 1.35.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.35.0 This release

4 release files No provenance

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