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

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

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

And use Aymara 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.

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 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 & 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.5.7.tar.gz (469.0 kB view details)

Uploaded Source

Built Distribution

aymara_ai-0.5.7-py3-none-any.whl (196.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aymara_ai-0.5.7.tar.gz
  • Upload date:
  • Size: 469.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for aymara_ai-0.5.7.tar.gz
Algorithm Hash digest
SHA256 ab89655ceeb7f10b3eac62a92aff559882718dece82147d8dedc6e9bb4f86379
MD5 0ee0df5d94cf5ab4a37833743d5e444a
BLAKE2b-256 cb8329822408a4a441298ee763fe401954451822b1b0ea6d7468819730cc9c1c

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

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

File metadata

  • Download URL: aymara_ai-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 196.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for aymara_ai-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b44a91bfc61ca8f96accf2faf0b966c399c3f2567df9bbe59f9312b351e30d9f
MD5 9e978baf0a32dc9cdbd86f081556cbba
BLAKE2b-256 d9b0d19bbf857973b4b8192211486564d6fa767ebc30ae323e1a4a25ad837ce6

See more details on using hashes here.

Provenance

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

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

Attestations:

Supported by

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