Skip to main content

Official Python SDK for the Trytet Engine — sub-millisecond Wasm sandbox for AI agents

Project description

Trytet Python SDK

Official Python client for the Trytet Engine — a sub-millisecond, hyper-ephemeral Wasm execution substrate for AI agents.

Installation

pip install trytet-client

Quick Start

import asyncio
from trytet_client import TrytetClient, TetExecutionRequest

async def main():
    async with TrytetClient(base_url="http://localhost:3000") as client:
        # Execute a Wasm payload
        with open("my_agent.wasm", "rb") as f:
            payload = list(f.read())

        result = await client.execute(TetExecutionRequest(
            payload=payload,
            allocated_fuel=1_000_000,
            alias="my-agent",
        ))
        print(f"Status: {result.status}")
        print(f"Fuel consumed: {result.fuel_consumed}")

        # List available MCP tools
        tools = await client.list_tools()
        for tool in tools:
            print(f"  {tool.name}: {tool.description}")

        # Invoke a cartridge
        from trytet_client import CartridgeInvocation
        cart_result = await client.invoke_cartridge(CartridgeInvocation(
            component_id="js-evaluator",
            payload="2 + 2",
            fuel=1_000_000,
        ))
        print(cart_result.output)

asyncio.run(main())

Features

  • Full async HTTP client with retry and backoff
  • MCP (Model Context Protocol) support — tools, resources, prompts
  • Cartridge management API
  • WebSocket telemetry streaming
  • Pydantic models for all API types
  • Type-safe request/response handling

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trytet_client-0.2.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

trytet_client-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file trytet_client-0.2.0.tar.gz.

File metadata

  • Download URL: trytet_client-0.2.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for trytet_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4aea4bf0419d5aff093373c1dfe1f7ef084814ff6f5a662d7535898a909d0e04
MD5 74760a3970666ce126b4e0d62072d869
BLAKE2b-256 da6680081aa72140643428373880c77c3c44e62c2b0c8fbab64725a953fd9a6f

See more details on using hashes here.

File details

Details for the file trytet_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: trytet_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for trytet_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22b7c9de62527cbcae43e1f85d861c24a34a29196dfa2cecf75225ec28a06a47
MD5 8cd0e83ce62b086e47f8a59414cf1c7d
BLAKE2b-256 a35f8e6a5ee48644c3e5e433d1b0742f7aee0acb3d167389a198b0d8cacd3df4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page