Skip to main content

Track OpenAI, Claude, Gemini and OpenAI-compatible models then give solutions to improve your agent system.

Project description

AT

AT: Track, log, and evaluate AI models. Supports OpenAI, Claude, Google API and custom PyTorch models.
Our goal is to make llm application more valuable and effortlessly improve llm capabilities.

Quickstart

You can use pip install AT. (It's not implemented now.)

pip install aitrace

OR pip install from source.

git clone https://github.com/yanghui1-arch/AITrace.git
cd src
pip install -e .

Then you need to configure AT through CLI.

aitrace configure

It needs an AITrace API key. You can get the apikey after logging http://localhost:5173. Finally use @track to track your llm input and output

from aitrace import track
from openai import OpenAI

openai_apikey = 'YOUR API KEY'


@track(
    project_name="aitrace_demo",
    tags=['test', 'demo'],
    track_llm=LLMProvider.OPENAI,    
)
def llm_classification(film_comment: str):
    prompt = "Please classify the film comment into happy, sad or others. Just tell me result. Don't output anything."
    cli = OpenAI(base_url='https://api.deepseek.com', api_key=openai_apikey)
    cli.chat.completions.create(
        messages=[{"role": "user", "content": f"{prompt}\nfilm_comment: {film_comment}"}],
        model="deepseek-chat"
    ).choices[0].message.content
    llm_counts(film_comment=film_comment)
    return "return value"

@track(
    project_name="aitrace_demo",
    tags=['test', 'demo', 'second_demo'],
    track_llm=LLMProvider.OPENAI,
)
def llm_counts(film_comment: str):
    prompt = "Count the film comment words. just output word number. Don't output anything others."
    cli = OpenAI(base_url='https://api.deepseek.com', api_key=openai_apikey)
    return cli.chat.completions.create(
        messages=[{"role": "user", "content": f"{prompt}\nfilm_comment: {film_comment}"}],
        model="deepseek-chat"
    ).choices[0].message.content

llm_classification("Wow! It sucks.")

Then it will output your llm trace. It is not supported to visualize now. I am developing it more and more quickly. Welcome to all contributions.

Development

AT project package manager is uv. If you are a beginner uver, please click uv link: uv official link

uv install
uv .venv/Script/activate

You can watch more detailed debug information by using --log-level=DEBUG or set AT_LOG_LEVEL=DEBUG for Windows or export AT_LOG_LEVEL=DEBUG for Linux and Mac.

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

mwin-0.1.2.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

mwin-0.1.2-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file mwin-0.1.2.tar.gz.

File metadata

  • Download URL: mwin-0.1.2.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for mwin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d52e027bb2f32f45c9bc7d7ebca3a2d99b596c52fb5feb787330b9500c4fe58e
MD5 a93127c9a7fe8673064c563d0d289d3c
BLAKE2b-256 3f4f6b7e74bb404e81bf75547328285bf35dbb5826a334574f9fc0ca5cdde84b

See more details on using hashes here.

File details

Details for the file mwin-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mwin-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for mwin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 73f6e04262ee39617f652636f88b71a35c296cd96c007f07bd4fc84cb157a360
MD5 b28aa5fed4c12cdcc1eb91987a6d202a
BLAKE2b-256 9cedf2bd277ad796e688ac625b58ff53fd037cfba3938093f44105f0c3da8588

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