Track OpenAI, Claude, Gemini and OpenAI-compatible models then give solutions to improve your agent system.
Project description
mwin
mwin: Track OpenAI, Claude, Gemini and OpenAI-compatible models then give solutions to improve your agent system.
Our goal is to make llm application more valuable and effortlessly improve llm capabilities.
Quickstart
You can use pip install mwin
pip install mwin
OR pip install from source.
git clone https://github.com/yanghui1-arch/mwin.git
cd src
pip install -e .
Then you need to configure mwin through CLI.
mwin configure
Then you just follow the instructions to configure mwin.
> Which deployment type do you choose?
> 1 - mwin Cloud Platform (default)
> 2 - mwin Local Platform
> Please input the choice number.>2
> Please enter your API key:
> Congrats to configure aitrace.
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 mwin import track, LLMProvider
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.")
Development
Mwin project package manager is uv. If you are a beginner uver, please click uv link: uv official link
uv sync
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
Release history Release notifications | RSS feed
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 mwin-0.1.4.tar.gz.
File metadata
- Download URL: mwin-0.1.4.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50266d55be97de20fe0fcbb46f2df4a3a224e0307cac73a2fc3c5939c65c4a98
|
|
| MD5 |
bbab72e75b5f8b5f4650d768fdfc4dd8
|
|
| BLAKE2b-256 |
10399f451d00b481b7aa828324ee70e069881a1a97ec503d4052d2ecaa328fb9
|
File details
Details for the file mwin-0.1.4-py3-none-any.whl.
File metadata
- Download URL: mwin-0.1.4-py3-none-any.whl
- Upload date:
- Size: 39.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6d4bc06f6f2830914b6309a434e1940a3a00b02c30ba575140e23f4c87f6771
|
|
| MD5 |
164a4a895e8a38d3e2581bb2c36bf0f5
|
|
| BLAKE2b-256 |
4995142e01b7dedfca4dbad27831008f665c82ad6352dfdbd78c8c6accba40bf
|