Skip to main content

⚒️ AlphaTrion is an open-source framework to help build GenAI applications, including experiment tracking, adaptive model routing, prompt optimization and performance evaluation.

Project description

alphatrion

Open, modular framework to build GenAI applications.

stability-alpha Latest Release

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 source start.sh to 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.

Star History Chart

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

alphatrion-0.0.4.tar.gz (410.7 kB view details)

Uploaded Source

Built Distribution

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

alphatrion-0.0.4-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file alphatrion-0.0.4.tar.gz.

File metadata

  • Download URL: alphatrion-0.0.4.tar.gz
  • Upload date:
  • Size: 410.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.1.0

File hashes

Hashes for alphatrion-0.0.4.tar.gz
Algorithm Hash digest
SHA256 50e80d4b1e3a79cd61e48c15ca84c5089fd41d4102756672be20587c8f8e6d62
MD5 3e096c780044b1ad87ee4b86b4421629
BLAKE2b-256 5db8b582831078c2dd34b9d88f1faf1ad1947bf0e38e9b760dcfc0f93c506fb2

See more details on using hashes here.

File details

Details for the file alphatrion-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: alphatrion-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 24.5 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

Hashes for alphatrion-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a3b687c808b956584bf07d84004c1227ff5377b3a1da98284bc1815cfecf02d
MD5 c9609cbb82512b53508799bbe15e042a
BLAKE2b-256 2613bbd4550ee628b2a112de87bdfa84e1cbcd16b6c724c880a72a12305ab098

See more details on using hashes here.

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