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 & 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.7.1.tar.gz (6.2 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.7.1-py3-none-any.whl (5.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aymara_ai-0.7.1.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aymara_ai-0.7.1.tar.gz
Algorithm Hash digest
SHA256 02c4d99e9ca971c25c7dc05acc1cc9fce7b11b95e4c9db00f4d69ddaadfa2ad9
MD5 a70c81282b09ff099f6592c79c98cc6e
BLAKE2b-256 380d5f85c1fceb547f2d66d6a4ac41415060e4478504e226361846b0145c3894

See more details on using hashes here.

Provenance

The following attestation bundles were made for aymara_ai-0.7.1.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.7.1-py3-none-any.whl.

File metadata

  • Download URL: aymara_ai-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aymara_ai-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d75c11468e05e2cd6dc96cb6ec695db5e3165839c95e99d44234360bde906c6
MD5 887f6d6e912f7b6c325496b32e2954cf
BLAKE2b-256 8c80b954d032bcd5f24da787cf4ee1b48808d8b747307ba97caf93a6e2b585f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aymara_ai-0.7.1-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