Skip to main content

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:
> What's your project name? mwin-demo
> Congrats to configure mwin.

It needs an Mwin 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(
    tags=['test', 'demo'],
    llm_provider=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(
    tags=['test', 'demo', 'second_demo'],
    llm_provider=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


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.9.tar.gz (32.9 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.9-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mwin-0.1.9.tar.gz
Algorithm Hash digest
SHA256 401777ea149fed79a09eafffa869e4366b3b213ec047cd146f720fd011c95108
MD5 5e366d3fd8875d2aa3f3b70a7bcf9c60
BLAKE2b-256 bb0b25b981cf21d8a626534f79e9019e317c74bb7dede6068a50906b7c829b98

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mwin-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7c839c7d27e9acc3afed57bd34b1d0a820a07dc6332ae69d9698c3e27eebff75
MD5 d70564a64f8ea54d1eae96c3b27c5a0e
BLAKE2b-256 a3a001e534bbe5a12ae779ba6b7715e48bb34b90d0b6000b30054cee968e0752

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