Metadata-Version: 2.4
Name: mikon
Version: 0.0.4
Summary: Self-hosted AI development manager for GPU job execution on your own servers
Project-URL: Homepage, https://github.com/miko-misa/mikon
Project-URL: Repository, https://github.com/miko-misa/mikon
Project-URL: Issues, https://github.com/miko-misa/mikon/issues
Project-URL: Changelog, https://github.com/miko-misa/mikon/releases
Author-email: miko-misa <hacnosuke@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: amd,deep-learning,experiment-tracking,gpu,job-management,machine-learning,mlops,nvidia
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: bleach<7,>=6.1
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: httpx<1,>=0.27
Requires-Dist: markdown<4,>=3.6
Requires-Dist: nvidia-ml-py<13,>=12.550
Requires-Dist: psutil<8,>=5.9
Requires-Dist: pydantic<3,>=2.8
Requires-Dist: pygments<3,>=2.18
Requires-Dist: pymdown-extensions<11,>=10.11
Requires-Dist: sse-starlette<4,>=2.1
Requires-Dist: typer<1,>=0.12
Requires-Dist: uvicorn[standard]<1,>=0.30
Requires-Dist: watchfiles<2,>=0.22
Description-Content-Type: text/markdown

# mikon

> 日本語版: [README-ja.md](README-ja.md)

A self-hosted tool for managing AI development (training and evaluation jobs) on GPU servers from a browser.

**Write Python the way you normally would, and just add a decorator to your functions.** mikon automatically discovers your jobs, generates config forms, allocates GPUs, launches runs, and displays metrics, logs, and artifacts in real time.

---

## Features

- **Decorator-only discovery** — Just add `@mikon.job`. No registration step, no code changes required.
- **Auto-generated config UI** — Pydantic fields on `class Config(mikon.Config)` become form widgets automatically (sliders, selects, checkboxes, etc.)
- **NVIDIA and AMD support** — Specify GPUs in unified `nvidia:0` / `amd:0` format. `CUDA_VISIBLE_DEVICES` / `ROCR_VISIBLE_DEVICES` are set automatically.
- **Live monitoring** — Metric charts and log streams update every few seconds via SSE.
- **Artifact management** — Call `ctx.log_artifact()` to make files downloadable from the browser.
- **Lineage tracking** — `ctx.use_dataset()` / `ctx.use_artifact()` automatically build an upstream/downstream graph.
- **Module system** — Register swappable components with `@mikon.module`; the UI generates a module-selection form automatically.
- **Dataset management** — Register existing paths or create datasets with a builder function.
- **Document viewer** — Markdown, Typst, and TypMark files placed in `docs/` are viewable in the dashboard.
- **File-based persistence** — No SQL database required. Everything is stored as text files under `.mikon/`.
- **Independent processes** — Jobs keep running even if the dashboard is restarted.

---

## Requirements

- Python 3.11+
- GPU server with NVIDIA drivers or AMD ROCm installed
- `typst` CLI (optional, for Typst document rendering)
- `typmark-cli` CLI (optional, for TypMark document rendering)

---

## Quick Start

```bash
# Install
uv tool install mikon   # or: pip install mikon

# Initialize project
mikon init
```

```python
# src/train.py
import mikon
from mikon import Config, RunContext
from pydantic import Field
from typing import Literal

class TrainConfig(Config):
    lr: float = Field(1e-3, gt=0, le=1)
    epochs: int = Field(10, ge=1, le=1000)
    optimizer: Literal["adam", "sgd"] = "adam"

@mikon.job
def train(config: TrainConfig, ctx: RunContext) -> None:
    for epoch in range(config.epochs):
        loss = 1.0 / (epoch + 1)
        ctx.log_metric("loss", loss, step=epoch)
```

```bash
# Start the server on the GPU machine
mikon serve

# Launch a job from the CLI
mikon run train --gpu nvidia:0

# Access the dashboard from your local machine via SSH port forwarding
ssh -L 8000:localhost:8000 you@gpu-server
# → Open http://localhost:8000 in your browser
```

---

## Installation

```bash
uv tool install mikon   # recommended
pip install mikon
```

Dependencies (`pynvml`, `psutil`, `watchfiles`, `fastapi`, etc.) are installed automatically.

---

## Documentation

For the full usage guide, SDK reference, CLI options, and API error model, see [USAGE.md](USAGE.md).

---

## License

MIT
