Skip to main content

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.

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

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

  3. 🎯 Accuracy. Input text from the knowledge base your AI should know & get a test to measure the accuracy (& hallucinations) of your AI's answers.

  4. 🔄 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aymara_ai-0.8.5.tar.gz (5.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aymara_ai-0.8.5-py3-none-any.whl (5.5 MB view details)

Uploaded Python 3

File details

Details for the file aymara_ai-0.8.5.tar.gz.

File metadata

  • Download URL: aymara_ai-0.8.5.tar.gz
  • Upload date:
  • Size: 5.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aymara_ai-0.8.5.tar.gz
Algorithm Hash digest
SHA256 9a156174d0566f1555be8106553b87cc3056361df72f8cc8077ae6e3fd20a093
MD5 5c0f9576492f43eff780ad61831928d8
BLAKE2b-256 beebfeaf530fbd31e92d0018a5bba574adfec5db74e6aa13ac36aa4c32f3c54b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aymara_ai-0.8.5.tar.gz:

Publisher: release.yml on aymara-ai/aymara-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aymara_ai-0.8.5-py3-none-any.whl.

File metadata

  • Download URL: aymara_ai-0.8.5-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.9

File hashes

Hashes for aymara_ai-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c827a5f3ea3371268be40552f9960e1bd045fbf6b4156910b9b648f13d0db4e2
MD5 f853649ce8f14a792d5e31c66aaf29d0
BLAKE2b-256 765e71b34dacb5fde3d4301201a84f094f8299e1a77135d9152910290844551e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aymara_ai-0.8.5-py3-none-any.whl:

Publisher: release.yml on aymara-ai/aymara-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page