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 AI model (e.g., a fine-tuned Llama model) or application (e.g., a chatbot powered by GPT).
Use Aymara to create custom red team tests.
-
🦺 Safety. Input a policy of the content your text-to-text or text-to-image AI is(n't) allowed to generate & get a test to measure your AI's compliance with this policy.
-
🧨 Jailbreaks. Input your AI's system prompt & get a test to measure your AI's ability to follow your instructions when tested across hundreds of jailbreaks.
-
🎯 Accuracy. Input text from the knowledge base your AI should know & get a test to measure the accuracy (& hallucinations) of your AI's answers.
-
🔄 Multiturn (coming soon). Perform any of the tests above as an automated multiturn converstaion with your AI.
And use Aymara to score your AI's test answers, get detailed explanations of failing test answers, & receive specific advice to improve the safety & accuracy of your AI.
Access
Access Aymara in a free trial with limited functionality or as a paid service with full functionality.
Our Python SDK provides convenient access to our REST 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 the full SDK reference & guides to walk you through:
- text-to-text safety tests (including the free trial version)
- text-to-image safety tests
- jailbreak tests
- accuracy 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 & 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 & 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
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 aymara_ai-0.8.1.tar.gz.
File metadata
- Download URL: aymara_ai-0.8.1.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa7d2d096f22ce15371197ad558c056afd3d0c387feb15cdc075f2142b648063
|
|
| MD5 |
7669100449a7a2ae6fee51da0622702f
|
|
| BLAKE2b-256 |
954a4ec0e39567e35f9cb5215959894629c18d4c125799b740eba5566187c108
|
Provenance
The following attestation bundles were made for aymara_ai-0.8.1.tar.gz:
Publisher:
release.yml on aymara-ai/aymara-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aymara_ai-0.8.1.tar.gz -
Subject digest:
fa7d2d096f22ce15371197ad558c056afd3d0c387feb15cdc075f2142b648063 - Sigstore transparency entry: 168249209
- Sigstore integration time:
-
Permalink:
aymara-ai/aymara-sdk@3d7a0c5cb64926013fc8dfbc4b9c0390b057a56c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aymara-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d7a0c5cb64926013fc8dfbc4b9c0390b057a56c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aymara_ai-0.8.1-py3-none-any.whl.
File metadata
- Download URL: aymara_ai-0.8.1-py3-none-any.whl
- Upload date:
- Size: 5.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af2a35b8c25ae0906c269aff14c3bcddae40bea83b9ed75a0663613c393775d9
|
|
| MD5 |
e5b5c8b6c7cc9b0a1d75ca44524c37bb
|
|
| BLAKE2b-256 |
9d1e63233258bf072dbe31966ce156db9a9403470149eaf709a8a2274a3e3a21
|
Provenance
The following attestation bundles were made for aymara_ai-0.8.1-py3-none-any.whl:
Publisher:
release.yml on aymara-ai/aymara-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aymara_ai-0.8.1-py3-none-any.whl -
Subject digest:
af2a35b8c25ae0906c269aff14c3bcddae40bea83b9ed75a0663613c393775d9 - Sigstore transparency entry: 168249212
- Sigstore integration time:
-
Permalink:
aymara-ai/aymara-sdk@3d7a0c5cb64926013fc8dfbc4b9c0390b057a56c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aymara-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d7a0c5cb64926013fc8dfbc4b9c0390b057a56c -
Trigger Event:
workflow_dispatch
-
Statement type: