Skip to main content

AI coding agent for machine learning tasks: create, execute, and evaluate notebooks, and improve ML models.

Project description

mlcode

AI coding agent for machine learning tasks

Create, execute, and evaluate Jupyter notebooks, iterate on model architectures, and automate ML workflows directly from your terminal.


What is mlcode?

mlcode is an AI coding agent tailored for machine learning workflows. Operating inside your terminal or notebook workspace, it helps you:

  • Create, edit, & run Jupyter notebooks for data exploration, model training, and evaluation.
  • Iterate on ML models — tweak hyperparameters, benchmark metrics, and refactor training pipelines.
  • Automate experiment loops — inspect stack traces, fix code errors, and log results.
  • Maintain session history — durable session trees with branching, resume, and compaction.
tau_coding  →  tau_agent  →  tau_ai
  • tau_ai: Model provider streaming layer (OpenAI, Anthropic, OpenRouter, local models).
  • tau_agent: Portable agent brain (messages, tools, events, session tree).
  • tau_coding: CLI application, Textual interactive TUI, file/shell tools, and resources.

Quickstart

Installation

mlcode requires Python 3.12 or newer.

From PyPI:

# Using uv (recommended)
uv tool install mlcode-ai

# Using pip
pip install mlcode-ai

For local development:

uv run mlcode

Usage

Run mlcode from your ML project directory:

cd my-ml-project
mlcode

Then prompt mlcode in the interactive TUI:

build a baseline PyTorch model for CIFAR-10 in a notebook and evaluate accuracy

Non-interactive print mode for scripts:

mlcode -p "summarize dataset structure in data/"
mlcode --cwd /path/to/project -p "run notebook and output evaluation metrics"

Connect a Model Provider

Start mlcode and authenticate your AI provider with /login:

/login
/login openai
/model

Supported providers include OpenAI, Anthropic, OpenRouter, OpenAI Codex, Hugging Face, and local OpenAI-compatible endpoints (Ollama, vLLM, DeepSeek).


Capabilities

  • Interactive TUI & Print Mode: Full terminal interface powered by Textual or non-interactive CLI.
  • Coding & Execution Tools: read, write, edit, and bash execution.
  • Notebook & ML Automation: Work with scripts, notebooks, and experiment loops.
  • Durable Sessions: Append-only JSONL session histories with tree branching (/tree) and recovery.
  • Custom Skills & Instructions: Support for project-level instructions (AGENTS.md) and custom skills.

License

Released under the MIT License.

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

mlcode_ai-0.1.4.tar.gz (507.3 kB view details)

Uploaded Source

Built Distribution

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

mlcode_ai-0.1.4-py3-none-any.whl (187.2 kB view details)

Uploaded Python 3

File details

Details for the file mlcode_ai-0.1.4.tar.gz.

File metadata

  • Download URL: mlcode_ai-0.1.4.tar.gz
  • Upload date:
  • Size: 507.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mlcode_ai-0.1.4.tar.gz
Algorithm Hash digest
SHA256 144475589ff8456c85791dac960dee59571d952c5eeddf3cc641f6a18de437d2
MD5 54af5e1eb2a860f9e1018da6cbb29d5c
BLAKE2b-256 45bba12b2fae1cdc02d74b56c8f68df7b2c199889be904aee6fbecb5a7d8c830

See more details on using hashes here.

File details

Details for the file mlcode_ai-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: mlcode_ai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 187.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mlcode_ai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3dbeaa757b65738d346ab4a9ad94d6900d1d972d1309c497762eca9cb8cde27f
MD5 f9bf0e673ea3b2385d3949059d6871fa
BLAKE2b-256 7cc2407d6aff2c0d7b86d5871f7a653b9a14d88a3b62163ebf9b9c84cb161bd7

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