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 logic-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 config-level abstraction for a specific set of hyperparameters or configurations within an experiment. It is a single execution of a particular configuration.
  • Run: A Run is a real execution instance of a trial. It represents the actual execution of the code with the specified configuration and hyperparameters defined in 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:8081 to see the Postgres database with following credentials. Remember to register the server first.

Email:       alphatrion@inftyai.com
Password:    alphatr1on
ServerName:  alphatrion
HostName:    postgres
ServerPWD:   alphatr1on

Run a Simple 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_experiment") as exp:
  async with exp.start_trial(name="my_trial") as trial:
    run = trial.start_run(lambda: log())
    await run.wait()

View Dashboard

The dashboard is under active development. You can already run the frontend locally to explore experiments, trials, runs, and metrics through the UI.

Prerequisites

Make sure the following are installed:

  • Node.js ≥ 18
  • npm ≥ 9
  • Vite

Launch Dashboard

alphatrion server # Start the backend server
alphatrion dashboard # Start the dashboard

Dashboard is available at http://localhost:3000 by default.

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.1.0.tar.gz (21.4 MB view details)

Uploaded Source

Built Distribution

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

alphatrion-0.1.0-py3-none-any.whl (368.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alphatrion-0.1.0.tar.gz
  • Upload date:
  • Size: 21.4 MB
  • 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.1.0.tar.gz
Algorithm Hash digest
SHA256 5905ba4bfa9625dd7a6cc2605d76d9fce37f9c8e08589f1c7adc9c0511b9210c
MD5 5843d140ea19a9a76b080f87187c981e
BLAKE2b-256 de3246c4b00363748bdd3a34f50a667a8eeb1ca894675c4eda914cb9d88e6d1a

See more details on using hashes here.

File details

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

File metadata

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

Hashes for alphatrion-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d8a5116faaadea533006ca3101125df105bc7bb7611fe8eff5e0a8bc47a85c2
MD5 2068e36343b392e1eb923a813a90c577
BLAKE2b-256 fcb09f1e7557ecbbe11210530e0d1877a4888ae3df092f83f1d28980182e35eb

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