@mlflow/qwen-code
v0.3.0
Published
Qwen Code integration package for MLflow Tracing
Maintainers
Readme
MLflow Typescript SDK - Qwen Code
Seamlessly integrate MLflow Tracing with Qwen Code to automatically trace your Qwen Code coding-agent conversations, including user prompts, assistant responses, tool usage, and token consumption.
| Package | NPM | Description |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| @mlflow/qwen-code | | Auto-instrumentation integration for Qwen Code. |
Installation
npm install -g @mlflow/qwen-codeThis installs the mlflow-qwen-code CLI globally. If you'd rather not install globally, you can invoke it via npx @mlflow/qwen-code (every command below works the same way).
Quickstart
Start MLflow Tracking Server if you don't have one already:
pip install mlflow
mlflow server --port 5000Self-hosting MLflow server requires Python 3.10 or higher. If you don't have one, you can also use managed MLflow service for free to get started quickly.
Run the interactive setup. It registers a Qwen Code Stop hook and writes your tracking URI / experiment ID into Qwen Code's config directory:
mlflow-qwen-code setupThe setup command prompts you to choose between a project-local install (./.qwen/) or a user-level install (~/.qwen/), then writes:
settings.json: adds aStophook entry so Qwen Code invokesmlflow-qwen-code stop-hookat the end of each session turn.mlflow-tracing.json: persists your MLflow tracking URI and experiment ID.
Pass --non-interactive / -y to skip prompts and use defaults, or override values with --tracking-uri and --experiment-id:
mlflow-qwen-code setup -y --tracking-uri http://localhost:5000 --experiment-id 0Use Qwen Code normally:
qwen "help me refactor this function"After each conversation turn, MLflow records a trace with the message history, tool calls and results, and token usage. You don't need to wait for the session to end.
Configuration
The mlflow-qwen-code hook resolves configuration in this order (first match wins):
MLFLOW_TRACKING_URI/MLFLOW_EXPERIMENT_IDenvironment variables./.qwen/mlflow-tracing.json(project-local)~/.qwen/mlflow-tracing.json(user-level)
Environment variables are convenient for one-off overrides, e.g. switching between a local server and a Databricks workspace:
MLFLOW_TRACKING_URI=databricks MLFLOW_EXPERIMENT_ID=123456789 qwen "..."Documentation 📘
Official documentation for MLflow Typescript SDK can be found here. For the full Qwen Code tracing guide including troubleshooting, see the Qwen Code integration page.
License
This project is licensed under the Apache License 2.0.
