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.0.5.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.0.5-py3-none-any.whl (368.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alphatrion-0.0.5.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.0.5.tar.gz
Algorithm Hash digest
SHA256 95d07c9920925e530d1048dc936e7a20b540adfa86c9f2afeef407554b6b79a7
MD5 44bd0d1a93c7eab3ce51029c29a822c0
BLAKE2b-256 d79136665d9c1d8214e21b861f993c56e465fa5eeb37ff33eef4f18b6e35341e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alphatrion-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 368.1 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 167782bda7b23f614248ed3887e22a877c972b8b6557bc95949effdb19f9dd23
MD5 eeb9de4232fc439c57c833074ecddbfa
BLAKE2b-256 4926c614b86bd3ad90cdc550ec0ecf2d073a8900cd4847569b3ac321f52e1210

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