Skip to main content

Installation

Install the package from PyPI:
pip install aris-sdk

Initialization

The Aris client is your main entry point. It handles:
  • Node Discovery: Finding active compute nodes.
  • Handshake: Negotiating payment and session tokens.
  • Execution: Sending prompts to the node.
from aris.client import Aris

client = Aris(
    api_key="your-api-key",       # Defaults to ARIS_API_KEY env var
    registry_url="http://..."     # Optional: For private networks
)

Usage

client.generate()

The core method to run inference.
response = client.generate(
    prompt="Explain quantum computing in one sentence.",
    model="tinyllama"  # Default model
)

print(response)
The client automatically handles the connection handshake. If a session token expires, it will attempt to refresh it automatically.

Helper Function

For quick, one-off scripts, you can use the top-level generate helper:
from aris.client import generate

print(generate("Hello world"))

Configuration

You can configure the client using environment variables to avoid hardcoding secrets.
VariableDescription
ARIS_API_KEYYour unique API key (starts with sk-).
ARIS_REGISTRY_URLURL of the registry (default: http://localhost:8000).

Error Handling

See the Error Handling page for details on ArisPaymentError and ArisNodeError.