Skip to main content

Python SDK for Evalio AI - LLM A/B testing platform

Project description

Evalio Python SDK

Python SDK for Evalio AI, an LLM experimentation platform for routing traffic between model or prompt variants, reporting metrics, and collecting feedback.

Package name

Install package:

pip install evalio-ai

Import path stays:

from evalio import EvalioClient

With Anthropic support:

pip install "evalio-ai[anthropic]"

Quick Start

from evalio import EvalioClient

client = EvalioClient(
    api_key="sk-evalio-your-key",
    base_url="https://evalio-ai-production.up.railway.app",
    provider_keys={"openai": "sk-your-openai-key"},
)

response = client.run(
    experiment_id=12,
    messages=[{"role": "user", "content": "How do I reset my password?"}],
    user_id="user-123",
    idempotency_key="support-reset-user-123-msg-001",
    provider_params={"temperature": 0.2},
)

print(response.content)
print(response.variant)
print(response.request_id)
print(response.cost_usd)
print(response.latency_ms)

What the SDK does

  1. Calls Evalio to get a routing decision
  2. Calls the assigned provider/model
  3. Reports completion metrics back to Evalio
  4. Returns the provider response

Sticky assignment means the same user_id stays on the same variant after the first assignment.

Per-call provider parameters

If your app needs JSON mode or other call-specific provider options, pass them at runtime:

response = client.run(
    experiment_id=12,
    messages=[{"role": "user", "content": "Return valid JSON only"}],
    user_id="user-123",
    idempotency_key="json-user-123-msg-001",
    provider_params={
        "temperature": 0.2,
        "response_format": {"type": "json_object"},
    },
)

Runtime params are merged on top of the variant's saved extra_params.

Feedback

client.feedback(
    response.request_id,
    score=1,
    comment="Helpful answer",
    idempotency_key=f"feedback:{response.request_id}:thumbs-up",
)

Retry safety

EvalioClient.run(..., idempotency_key=...) and EvalioClient.feedback(..., idempotency_key=...) can be retried safely. The backend replays the original result instead of creating duplicates.

Supported providers

  • OpenAI
  • Anthropic via optional extra

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

evalio_ai-0.1.3.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.

evalio_ai-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file evalio_ai-0.1.3.tar.gz.

File metadata

  • Download URL: evalio_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evalio_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4b55eb655e179e3dccc850d55047ce3dd1333e6bc19abe81ef4733a9ca379b60
MD5 7f04e870a4a0804d710ed75669d86928
BLAKE2b-256 4fc66e6d0b757f824851e4367b7dabc96c05316c91015b1cccd8de6e71eb9d10

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalio_ai-0.1.3.tar.gz:

Publisher: python-sdk-publish.yml on Asicvfx/Evalio-AI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evalio_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: evalio_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evalio_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d35ea7fcca318e5db0f2c0ca7186e65a87684ab60833adb379dd40d49506d9ae
MD5 f76272e70f671a9f558677fb690f9045
BLAKE2b-256 288da13c09a2ca41bd9d832c495cb3b8f0714f8fa286eeb2d28212ca4d0bff28

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalio_ai-0.1.3-py3-none-any.whl:

Publisher: python-sdk-publish.yml on Asicvfx/Evalio-AI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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