Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Prediction Guard - Python Client

Migrating

The Prediction Guard API is compatible with both OpenAI-style and Anthropic-style clients. Use whichever SDK matches the functionality you need, pointed at the Prediction Guard API with your existing API key.

OpenAI-compatible SDK

pip install openai
import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PREDICTIONGUARD_API_KEY"],
    base_url="https://api.predictionguard.com",
)

response = client.chat.completions.create(
    model="<model-name>",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Anthropic-compatible SDK

pip install anthropic
import os

from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["PREDICTIONGUARD_API_KEY"],
    base_url="https://api.predictionguard.com",
)

message = client.messages.create(
    model="<model-name>",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)

For the full list of endpoints and models, see the Prediction Guard documentation.

Legacy documentation

The API documentation for this SDK remains available for reference but will not be updated.

Metadata

Release files for predictionguard 2.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for predictionguard 2.12.0
File Size Uploaded Provenance
predictionguard-2.12.0.tar.gz 976.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for predictionguard 2.12.0
File Interpreter ABI Platform
predictionguard-2.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / predictionguard-2.12.0.tar.gz

Download URL predictionguard-2.12.0.tar.gz
Size 976.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a0688ce34fb8acc0bb48317d4e32cf266d21f586e0557d082bcab435430436ec
BLAKE2b-256 checksum
How to use checksums
ac65cbfc0fe194e7a0c4e2b3fb49a420e7a3b55641b3fe7a215ea02f09104619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / predictionguard-2.12.0-py3-none-any.whl

Download URL predictionguard-2.12.0-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8801a6347503f67bfc09f6686162fb34cf6dc07dadbea48f20caed761cd74f7a
BLAKE2b-256 checksum
How to use checksums
71aaa2024334a9ca6df8f88b4a314435aca64d404767b3f35673dc95a3f1eaae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for predictionguard 2.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page