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.
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.