AI Verify advances Gen AI testing with Project Moonshot.
Project description
🎯 Motivation
Developed by the AI Verify Foundation, Moonshot is a tool to bring Benchmarking and Red-Teaming together to help AI developers, compliance teams evaluate LLM-based Apps and LLMs.
🚀 Why Moonshot
In the rapidly evolving landscape of Generative AI, ensuring safety, reliability, and performance of LLM applications is paramount. Moonshot addresses this critical need by providing a unified platform for:
- Benchmark Tests: Systematically test LLM Apps or LLMs across critical trust & safety risks using a wide array of open-source benchmark dataset and metrics, including guided workflows to implement IMDA's Starter Kit for LLM-based App Testing.
- Red Team Attacks: Proactively identify vulnerabilities and potential misuse scenarios in your LLM applications through streamlined adversarial prompting.
🔑 Key Features
- User-friendly Interfaces: Interact with Moonshot via an intuitive Web UI for visual insights, and an interactive Command Line Interface (CLI) for quick operations.
- Comprehensive Benchmarking:
- View list of available datasets available
- Test for Performance (e.g., accuracy, BLEU)
- Ensure Trust & Safety e.g., bias, toxicity, hallucination)
- Utilize built-in workflow to implement IMDA's Starter Kit for LLM-based App Testing. View available pre-built Cookbooks
- Powerful Red-Teaming:
- View list of available attack modules
- Simplify adversarial prompt generation using algorithmic strategies or generative LLM to uncover potential misuse.
- Leverage prompt templates, context strategies, and automated attack modules.
- Customizable Recipes: Build your own benchmark tests with custom datasets (input-target pairs), prompt templates (optional), evaluation metric, and grading scales. View available pre-built Recipes
- Insightful Reporting: Use our HTML reports with interactive charts for clear visualization of test results, and download detailed raw JSON results for deeper programmatic analysis.
- Extensible & Modular: Designed for easy extension and integration with new LLM applications, benchmarks, and attack techniques.
Getting Started
Moonshot can be used through several interfaces:
- User-friendly Web UI - Web UI User Guide
- Interactive Command Line Interface - CLI User Guide
- Seamless Integration into your MLOps workflow via Moonshot Library APIs or Moonshot Web APIs - Notebook Examples, Web API Docs
💻 Let's Go!
This section will guide you through getting Moonshot up and running.
✅ Prerequisites
-
Python: Version 3.11 is required.
-
Git Version Control: Git is essential for cloning the repository.
-
(Optional) Virtual Environment: Highly recommended to manage dependencies.
# Create a virtual environment python -m venv venv # Activate the virtual environment source venv/bin/activate -
If you plan to install our Web UI, you will also need Node.js version 20.11.1 LTS and above
⬇️ Installation
You can install Moonshot in various ways depending on your needs
1. Using pip (Recommended for most users)
# Install Project Moonshot's Python Library, which includes Moonshot's full functionalities (Library APIs, CLI and Web APIs)
pip install "aiverify-moonshot[all]"
# Clone and install test assets and Web UI
python -m moonshot -i moonshot-data -i moonshot-ui
⚠️ You will need to have test assets from moonshot-data before you can run any tests.
🖼️ If you plan to install our Web UI, you will also need moonshot-ui
Check out our Installation Guide for more details.
2. From Source Code (For developers and contributors)
# To install from source code (Full functionalities)
git clone git@github.com:aiverify-foundation/moonshot.git
cd moonshot
pip install -r requirements.txt
If you have installation issues, please take a look at the Troubleshooting Guide.
Other installation options
Here's a summary of other installation commands available:# To install Moonshot library APIs only
pip install aiverify-moonshot
# To install Moonshot library APIs and Web APIs only
pip install "aiverify-moonshot[web-api]"
# To install Moonshot library APIs and CLI only
pip install "aiverify-moonshot[cli]"
Check out our Installation Guide for more details.
🏃♀️ Run Moonshot
Running the Web UI
python -m moonshot web
Open http://localhost:3000/ in a browser and you should see this homepage:
Refer to this guide to discover the rich features available in Moonshot Web UI
Running the Interactive CLI
python -m moonshot cli interactive
Refer to this Command List to discover the list of CLI commands for Moonshot
📚 Documentation & User Guides
For detailed information on configuring, using, and extending Moonshot, please refer to our comprehensive documentation:
Guides for Moonshot Web UI
- Getting Started with Moonshot Web UI
- Creating Your Custom Cookbook via Moonshot Web UI
- Creating Your Custom Connector Endpoint via Moonshot Web UI
- Running Benchmark Test on Moonshot Web UI
- Running Red Teaming on Moonshot Web UI
Guides for Moonshot Interactive CLI
- Getting Started with Moonshot Interactive CLI
- Creating Your Custom Benchmark Tests for Your RAG Apps via Moonshot Interactive CLI
- Creating Your Custom Connector Endpoint via Moonshot Interactive CLI
- Running Benchmark Test on Moonshot Interactive CLI
- Running Red Teaming on Moonshot Interactive CLI
For Users Interested in trying Out Moonshot using Jupyter Notebook
🤝 Contribution
Moonshot is an open-source project, and we welcome contributions from the community! Whether fixing a bug, adding a new feature, improving documentation, or suggesting an enhancement, your efforts are highly valued.
Please refer to our Contributor Guide for details on how to get started.
✨ Project Status
Moonshot is currently in beta. We are actively developing new features, improving existing ones, and enhancing stability. We encourage you to try it out and provide feedback!
📜 License
Moonshot is released under the Apache Software License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiverify_moonshot-0.7.6.tar.gz.
File metadata
- Download URL: aiverify_moonshot-0.7.6.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1320b26243d79442b44c9d3a7dc38bce2840cf01bb6cf539e16510bcfb06d11a
|
|
| MD5 |
6d88e68ff95bbe19411e0476ee380a37
|
|
| BLAKE2b-256 |
5bfd1e0bfa0bd9a5e949ca8dec1f853b6ec0a4526b124f8772955b75eaf59945
|
Provenance
The following attestation bundles were made for aiverify_moonshot-0.7.6.tar.gz:
Publisher:
pypi-deployment.yaml on aiverify-foundation/moonshot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiverify_moonshot-0.7.6.tar.gz -
Subject digest:
1320b26243d79442b44c9d3a7dc38bce2840cf01bb6cf539e16510bcfb06d11a - Sigstore transparency entry: 919101135
- Sigstore integration time:
-
Permalink:
aiverify-foundation/moonshot@03e9344dc9fc949ae05b1f38580611fce36528ab -
Branch / Tag:
refs/heads/0.7.6 - Owner: https://github.com/aiverify-foundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deployment.yaml@03e9344dc9fc949ae05b1f38580611fce36528ab -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aiverify_moonshot-0.7.6-py3-none-any.whl.
File metadata
- Download URL: aiverify_moonshot-0.7.6-py3-none-any.whl
- Upload date:
- Size: 243.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b78af0b7ea03e212196a886802ccb0f08b4930db12f396546043baf0e4b1e90a
|
|
| MD5 |
43fe28559be8bba0113c9bd97a7f9713
|
|
| BLAKE2b-256 |
58be88db60c34facbc064bd02ffa8ee6b41404e5cb1e86f11393a9d70d295d2d
|
Provenance
The following attestation bundles were made for aiverify_moonshot-0.7.6-py3-none-any.whl:
Publisher:
pypi-deployment.yaml on aiverify-foundation/moonshot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiverify_moonshot-0.7.6-py3-none-any.whl -
Subject digest:
b78af0b7ea03e212196a886802ccb0f08b4930db12f396546043baf0e4b1e90a - Sigstore transparency entry: 919101140
- Sigstore integration time:
-
Permalink:
aiverify-foundation/moonshot@03e9344dc9fc949ae05b1f38580611fce36528ab -
Branch / Tag:
refs/heads/0.7.6 - Owner: https://github.com/aiverify-foundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deployment.yaml@03e9344dc9fc949ae05b1f38580611fce36528ab -
Trigger Event:
workflow_dispatch
-
Statement type: