Skip to content
 
 

Repository files navigation

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.

About

AI coding agent for machine learning tasks

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages