A Python SDK for using Aymara to test your AI alignment.
Project description
Aymara Python SDK
Hi! 👋 We're Aymara. We built this library to help you measure & improve the alignment of any text-to-text genAI model (e.g., a fine-tuned Llama model) or application (e.g., a chatbot powered by GPT).
Use the Aymara REST API to create custom red team tests.
-
🦺 Safety. Input text describing the content your genAI is(n't) allowed to generate & get a test to assess your genAI's compliance. (Text-to-image coming soon.)
-
🧨 Jailbreaks. Input your genAI's system prompt & get a test to assess your genAI's ability to follow your instructions when tested across hundreds of jailbreaks.
-
🎯 Accuracy (coming soon). Input text from the knowledge base your genAI should know & get a test to assess the accuracy (and hallucinations) of your genAI's answers.
And use the API to score your genAI's test answers, get detailed explanations of failing test answers, & receive specific advice to improve the safety & accuracy of your genAI.
API Access
The API is accessible in a free trial with limited functionality or as a paid service with full functionality.
Our Python SDK provides convenient access to the API from Python 3.9+. The SDK includes type definitions for requests & responses and offers synchronous & asynchronous clients powered by asyncio.
Documentation
docs.aymara.ai has our full library API & guides to walk you through safety tests (including the free trial version) & jailbreak tests.
Installation
Install the SDK with pip. We suggest using a virtual environment to manage dependencies.
pip install aymara-ai
Configuration
Get an Aymara API key and store it as an env variable:
export AYMARA_API_KEY=[AYMARA_API_KEY]
Or supply your key directly to the client:
client = AymaraAI(api_key="AYMARA_API_KEY")
Support and Requests
If you found a bug, have a question, or want to request a feature, reach out at support@aymara.ai or open an issue on our GitHub repo.
Versioning
This package generally follows SemVer conventions. Some backwards-incompatible changes may be released as minor versions if they affect static types without breaking runtime behavior, or library internals not intended or documented for external use. (Please open an issue if you are relying on internals).
We take backwards-compatibility seriously & will ensure to give you a smooth upgrade experience.
Requirements
Python 3.9 or higher.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file aymara_ai-0.5.2.tar.gz
.
File metadata
- Download URL: aymara_ai-0.5.2.tar.gz
- Upload date:
- Size: 442.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6066404914b385e37e6f90edc0b1adcc12b5f6f1f80e587e3bcca8d8f890cecf |
|
MD5 | 31fd74ed1bd933958bdb656acc5f28be |
|
BLAKE2b-256 | 25d86f17ba776636b8e85d85bc251cc4e71fe6c2162c8629eb173f1f8f7fdab2 |
File details
Details for the file aymara_ai-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: aymara_ai-0.5.2-py3-none-any.whl
- Upload date:
- Size: 186.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22eb11aa60caaa929ff58edd35cc11d3405b0cf5c0cf866c0f773b43af8b6267 |
|
MD5 | ad863620514480f2d6981e44ea4ce0f5 |
|
BLAKE2b-256 | 6aafd0e5474bd94af1e3fc57a07468ca85939f072ea54b431566c0c1013dc44b |