⚒️ AlphaTrion is an open-source framework to help build GenAI applications, including experiment tracking, adaptive model routing, prompt optimization and performance evaluation.
Project description
Open, modular framework to build GenAI applications.
AlphaTrion is an open-source framework to help build GenAI applications, including experiment tracking, adaptive model routing, prompt optimization, performance evaluation and so on. The name comes after the oldest and wisest Transformer - AlphaTrion.
Still under active development.
Concepts
- Project: A Project is a namespace-level abstraction that isolates experiments from different users or teams.
- Experiment: An Experiment is a high-level abstraction for organizing and managing a series of related trials. It serves as a way to group together multiple trials that share a common goal or objective.
- Trial: A Trial represents a single attempt or multiple iterations within an experiment. It encapsulates the configuration, execution, and results of a specific set of runs.
- Run: A Run is an execution of a specific configuration within a trial. It represents a real iteration of the trial.
Quick Start
Install from PyPI
pip install alphatrion
Install from Source
- Git clone the repository
- Run
uv syncto install dependencies frompyproject.toml. - Run
source start.shto activate the virtual environment.
Initialize the Environment
Run the following command for setup:
cp .env.example .env & make up
You can login to pgAdmin at http://localhost:8080 to see the Postgres database with following credentials:
Email: alphatrion@inftyai.com
Username: alphatrion
Password: alphatr1on
Server: postgres
Run a Sample Experiment
Below is a simple example with two approaches demonstrating how to create an experiment and log performance metrics.
import alphatrion as alpha
import uuid
# Better to use a fixed UUID to identify your project.
alpha.init(project_id=uuid.uuid4(), artifact_insecure=True)
async def log():
# Run your code here then log metrics.
await alpha.log_metrics({"accuracy": 0.95})
async with alpha.CraftExperiment.setup(name="my_first_experiment") as exp:
async with exp.start_trial(name="my_trial") as trial:
run = trial.start_run(lambda: log())
await run.wait()
View Results
Dashboard is coming soon! Meanwhile, you can query the results directly from the database.
Cleanup
make down
Contributing
We welcome contributions! Please refer to developer.md for more information on how to set up your development environment and contribute to the project.
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
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 alphatrion-0.0.3.tar.gz.
File metadata
- Download URL: alphatrion-0.0.3.tar.gz
- Upload date:
- Size: 410.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3d9932e2d441b7c8ff1c7cca7ad919c80e664a789e32d04cf8bc8172fd0a57
|
|
| MD5 |
3033a808fb3a66fce3370306bc8e6d98
|
|
| BLAKE2b-256 |
883c90c1474b5e34a939e14e536b3f00c2d4b5fe7acc3a066f237d4eb5b0366b
|
File details
Details for the file alphatrion-0.0.3-py3-none-any.whl.
File metadata
- Download URL: alphatrion-0.0.3-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5726c4f1b75a8181ef90505b3a8fe235fbcd2400cde1a468cbbad5718d7ea091
|
|
| MD5 |
f9164f2b16d4d512e20c03b7906ae9d0
|
|
| BLAKE2b-256 |
72bff667daa3283b6ba41ab685c0a0c3b91a6dd4c86f0b76cecded880f3dc6b5
|