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, FAQ, and 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.
Metadata
Release files for aymara-ai 0.8.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aymara_ai-0.8.5.tar.gz | 5.8 MB | With provenance | Details for aymara_ai-0.8.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aymara_ai-0.8.5-py3-none-any.whl | Python 3 | none | any | Details for aymara_ai-0.8.5-py3-none-any.whl |
Total release size: 11.3 MB
Release files / aymara_ai-0.8.5.tar.gz
| Download URL | aymara_ai-0.8.5.tar.gz |
|---|---|
| Size | 5.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a156174d0566f1555be8106553b87cc3056361df72f8cc8077ae6e3fd20a093
|
|
BLAKE2b-256 checksum How to use checksums |
beebfeaf530fbd31e92d0018a5bba574adfec5db74e6aa13ac36aa4c32f3c54b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2025.
Transparency logRelease files / aymara_ai-0.8.5-py3-none-any.whl
| Download URL | aymara_ai-0.8.5-py3-none-any.whl |
|---|---|
| Size | 5.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c827a5f3ea3371268be40552f9960e1bd045fbf6b4156910b9b648f13d0db4e2
|
|
BLAKE2b-256 checksum How to use checksums |
765e71b34dacb5fde3d4301201a84f094f8299e1a77135d9152910290844551e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2025.
Transparency logSecurity for aymara-ai 0.8.5
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aymara_ai-0.8.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2025.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.