PrismAI Python SDK
The PrismAI Python SDK covers the full platform: observability/tracing (OpenTelemetry-based, with OpenAI and LangChain integrations), datasets & experiments (offline evaluation and regression testing of prompt/model changes), LLM-as-a-judge and custom evaluations/scores, prompt management, and a full REST API client.
Installation
[!IMPORTANT] The SDK was rewritten in v4 and released in March 2026.
pip install prismai
Quickstart
# env: PRISMAI_PUBLIC_KEY, PRISMAI_SECRET_KEY, PRISMAI_BASE_URL
from prismai import get_client
prismai = get_client()
# Create a span using a context manager
with prismai.start_as_current_observation(as_type="span", name="process-request") as span:
# Your processing logic here
span.update(output="Processing complete")
# Create a nested generation for an LLM call
with prismai.start_as_current_observation(as_type="generation", name="llm-response", model="gpt-5.6") as generation:
# Your LLM call logic here
generation.update(output="Generated response")
# All spans are automatically closed when exiting their context blocks
# Flush events in short-lived applications
prismai.flush()
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 prismai_sdk-4.14.4.tar.gz.
File metadata
- Download URL: prismai_sdk-4.14.4.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc1bfe72f207dd9bfea50eef9f8be2512f7e0cd4b00ee33d851c1f19711fbe11
|
|
| MD5 |
2677ea98c9e4440296770da306ecf839
|
|
| BLAKE2b-256 |
1194f628fe595f56bf69cdd3a5c34e8a9615e8f522121519f2c3cb00c1b584bc
|
File details
Details for the file prismai_sdk-4.14.4-py3-none-any.whl.
File metadata
- Download URL: prismai_sdk-4.14.4-py3-none-any.whl
- Upload date:
- Size: 677.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f578bf7bd738116fa783171849c50b24a47c4cff135dcb04b245d972d6849db
|
|
| MD5 |
f922016fc8df3bb0c1c2395af1556ff2
|
|
| BLAKE2b-256 |
750f29fb9cacaa5981020f78909082b3403abfe0d0368c242dffe6a4b1f9c066
|