Skip to main content

Official Python SDK for ComputeSeal, the cryptographic verification layer for AI completions.

Project description

computeseal

The official Python SDK for ComputeSeal, the cryptographic verification layer for AI completions.

Wrap your AI completions with tamper-proof proof receipts, verifying latency, token usage, cost parameters, and gateway node signatures. Optionally anchor hashes to the Solana blockchain for public auditing.

Installation

You can install the SDK directly via pip:

pip install computeseal

Quickstart

Initialize the client and send verifiable inference completions:

import json
import os
from computeseal import ComputeSeal

# Initialize the client
seal = ComputeSeal(
    api_key=os.environ.get("COMPUTESEAL_API_KEY")
)

# Run a verifiable completion query
result = seal.chat(
    model="openrouter/llama-3.1-70b",
    messages=[
        {"role": "user", "content": "Explain zero-knowledge rollups simply."}
    ],
    receipt=True,       # Request cryptographic receipt
    anchor="solana"     # Write transaction memo to Solana ledger
)

# Print output response text
print(result.output)

# Print proof ledger details
print(json.dumps(result.receipt, indent=2))

Sandboxed Local Testing (No Server Needed)

If the SDK detects an API Key starting with cs_test_, the key mock_key, or if the environment variable COMPUTESEAL_MOCK=true is set, it will automatically fallback to high-fidelity offline local proof-proving simulation mode. This enables immediate integration tests in local dev sandboxes without requiring active backend endpoints.

Config Parameters

Parameter Type Description
api_key str Your ComputeSeal Gateway API Key (defaults to COMPUTESEAL_API_KEY env var).
base_url str The API Gateway URL endpoint (defaults to https://computeseal.com/api or COMPUTESEAL_BASE_URL env var).

Chat Options

Option Type Default Description
model str Required Model routing path (e.g., openai/gpt-4o-mini, groq/llama-3.1-8b-instant).
messages list Required Messages list mapping role (user, assistant, system) and content strings.
receipt bool True Generate cryptographic compute proof receipt block.
anchor str "solana" Ledger network options ("solana", "none", "off-chain").
temperature float None Gateway routing model temperature.
max_tokens int None Max tokens limit for response completion.
stream bool None Enable streaming completions.

License

MIT License.

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

computeseal-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

computeseal-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file computeseal-1.0.0.tar.gz.

File metadata

  • Download URL: computeseal-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for computeseal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fefad21a4e223f16a0b2c0649c8a768d14e78a6815465e9ae1afcc17a4f381a5
MD5 8d6b88af2cd87f3138d87a39a6448179
BLAKE2b-256 1efda3ae8ca03f4dcc5294156625bcaf039549b5514e579c5875f0e0de0a11f5

See more details on using hashes here.

File details

Details for the file computeseal-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: computeseal-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for computeseal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15f95d48c4cafa4cf9c9aca685dfc9277439f82479e6a13a7fb537e9e8387dd6
MD5 20c90410a9614b4fbf09e759c1551ba8
BLAKE2b-256 0e446f14f6fba17fc5ccb9884d9ae2430d8d946a9646299be15e022c909ced65

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