SDK for developing Cowboy Actors
Project description
Cowboy SDK
The official Python SDK for developing autonomous actors on the Cowboy PVM (Python Virtual Machine).
With this SDK, you can write fully deterministic on-chain Python code that interacts natively with LLMs, APIs, and the broader Cowboy ecosystem.
Features
- Decentralized AI Agents: Write prompt chains, FSM-based LLM logic, and MCP integrations directly in Python.
@runner.continuation: Turn Pythonasyncfunctions into verified Finite State Machines (FSMs) capable of pausing execution, offloading heavy compute (LLM inference, HTTP requests) to Runners, and seamlessly resuming on the next block.- Robust Determinism: The SDK strips away standard Python non-determinism (
time,random,set) and replaces it with consensus-safe primitives. - CBOR-backed State: The
CowboyModelandself.storagedict provide automatic schema validation and canonical CBOR serialization for zero-boilerplate state management. - Built-in Async Primitives: Leverage
TaskGroupfor concurrent Runner tasks,Retryfor robust backoff logic, andbounded_loopto ensure safety limits.
Quick Start
pip install cowboy-sdk
from cowboy_sdk import actor, runner, capture
@actor
class MyAgent:
def init(self, payload):
self.storage["calls"] = 0
return b"ok"
@runner.continuation
async def chat(self, msg):
ctx = capture()
ctx.prompt = msg.get("message", "Hello")
# Off-chain heavy compute (LLM) securely verified via consensus
result = await runner.llm(ctx.prompt, system_prompt="You are a helpful assistant")
# Execution resumes here on the next block
chat_id = self.storage.get("calls", 0)
self.storage[f"reply:{chat_id}"] = result
self.storage["calls"] = chat_id + 1
return b"ok"
def _a(): return MyAgent()
def init(p): return _a().init(p)
def chat(p): return _a().chat(p)
def chat__resume(p): return _a().chat__resume(p)
def on_runner_result(p): return _a().on_runner_result(p)
Documentation & Tools
- Developer Manual: View on GitHub
- Vibe Coding Blueprint (Claude Code): Learn how to set up autonomous development without local chain dependencies. View Guide.
- Cowboy CLI: Pre-compiled binary required to deploy and send transactions. Download from the GitHub Releases.
License
MIT License. See the repository for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cowboy_sdk-0.1.0.tar.gz.
File metadata
- Download URL: cowboy_sdk-0.1.0.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e8bb367c8e522920457f32b7f60acebb0963cbd95e437a2b745817fbf2994e
|
|
| MD5 |
be15f33c6d6996bcbdca918777823572
|
|
| BLAKE2b-256 |
34b7c7f46aced6923affd7869e4df15f6136dc6ffd822f00c7dfd255673ed3b6
|
File details
Details for the file cowboy_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cowboy_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53240e1d2d5d524710440c1cc2e967b1943b1ba3d5fc1ae7d8ef0bbe274fc974
|
|
| MD5 |
98f3c7af78290958068fe5bca18ac093
|
|
| BLAKE2b-256 |
72bdf7345c9592c922c0852a3e88807d4fa6fbaa1482fbce1773fa76c4b7fd62
|