{"slug": "mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account", "title": "Mltrackr – ML experiment tracking in 2 lines, no server, no account", "summary": "Mltrackr launches a lightweight ML experiment tracking tool that requires no server, no account, and no configuration, logging metrics in two lines of code. The open-source Python package stores data locally in a SQLite file and provides a visual dashboard, hyperparameter suggestions, and anomaly detection. It aims to replace heavier tools like MLflow and Weights & Biases for quick, offline tracking.", "body_md": "Track ML experiments in 2 lines of code. No server. No account. No config.\n\nYou're running a training loop. You want to know which hyperparameters worked best. You don't want to:\n\n- Set up a tracking server\n- Create an account on any service\n- Write to a cloud API\n- Configure environment variables\n- Install 47 dependencies\n\n**mltrackr is the answer.** Install it, wrap your loop, open a beautiful local dashboard. Done.\n\n**1. Install**\n\n```\npip install mltrackr\n```\n\nThis installs the\n\n`mltrackr`\n\ncommand and`import mltrackr`\n\nPython package.\n\n**2. Generate a ready-to-run example**\n\n```\npython -m mltrackr init --framework plain -o demo.py\n```\n\nOn most systems\n\n`mltrackr init`\n\nworks directly. If not, use`python -m mltrackr`\n\ninstead.\n\n**3. Run the demo (creates 6 fake training runs)**\n\n```\npython demo.py\n```\n\n**4. Inspect results in the terminal**\n\n```\npython -m mltrackr list\npython -m mltrackr best accuracy\npython -m mltrackr suggest accuracy\n```\n\n**5. Open the visual dashboard**\n\n```\npython -m mltrackr ui\n```\n\nThen open ** http://localhost:7000** in your browser. Press\n\n`Ctrl+C`\n\nto stop.\n\n``` python\nimport mltrackr\n\nwith mltrackr.run(\"resnet-baseline\", tags=[\"cv\", \"baseline\"]):\n    mltrackr.log(lr=1e-3, batch_size=64, optimizer=\"adam\")\n\n    for epoch in range(50):\n        loss, acc = train_one_epoch(model, dataloader)\n        mltrackr.log(loss=loss, accuracy=acc, epoch=epoch)\n\n    mltrackr.note(\"Solid baseline - try lr=5e-4 next\")\n# If 'mltrackr' works directly on your system:\nmltrackr ui\nmltrackr list\nmltrackr best accuracy\nmltrackr suggest accuracy\nmltrackr report\n\n# If not (e.g. Windows), use:\npython -m mltrackr ui\npython -m mltrackr list\npython -m mltrackr best accuracy\n```\n\nEverything is saved locally in `~/.mltrackr/experiments.db`\n\n. A single SQLite file. Copy it, back it up, open it in any SQLite browser.\n\nGot good results?Run`mltrackr share accuracy`\n\nto generate a ready-to-post Twitter/X or Hacker News summary. If mltrackr saved you time, a ⭐ on GitHub goes a long way!\n\n**The real problem:** you're hacking on a model, you want to log some metrics, but setting up MLflow takes 15 minutes and W&B wants you to create an account and send your data to the cloud. So you end up writing metrics to a text file or just... not tracking anything. Then you forget which hyperparameters worked. Then you run the same failed experiment again.\n\n**mltrackr is the experiment tracker that's actually available when you need it.**\n\nmltrackr |\nMLflow |\nWeights & Biases |\n|\n|---|---|---|---|\n| Setup time | 5 seconds |\n~15 minutes | ~5 minutes |\n| Requires account | ❌ No | ❌ No | ✅ Yes |\n| Requires running server | ❌ No | ✅ Yes | ❌ No (cloud) |\n| Works offline | ✅ Always | ❌ No | |\n| Data stays local | ✅ Always | ✅ Yes | ❌ No |\n| Live anomaly detection | ✅ Built-in | ❌ No | |\n| Hyperparameter suggestions | ✅ Built-in | ❌ No | |\n| Auto-generated reports | ✅ Built-in | ❌ No | ❌ No |\n| Free forever | ✅ MIT | ✅ Apache |\n\nWrap any loop. Log any value. Works with every framework.\n\n``` python\nimport mltrackr\n\nwith mltrackr.run(\"gpt-finetune\", tags=[\"nlp\", \"v3\"]):\n    mltrackr.log(lr=2e-5, epochs=3, model=\"gpt2\")\n    for step, batch in enumerate(dataloader):\n        loss = model.train_step(batch)\n        mltrackr.log(loss=loss.item(), step=step)\nmltrackr ui\n```\n\nOpens at `http://localhost:7000`\n\n— a fast, dark-mode single-page app with:\n\n- Searchable run list with\n**inline sparkline charts** in the sidebar **Trend indicators**(↑ ↓) showing whether each metric is improving** Side-by-side comparison**of any runs you select (best value highlighted)** Auto-generated time-series charts**with gradient fills** Metric progress bars**showing where the latest value sits in its historical range- Global statistics view — success rate, most-logged metrics, run timeline\n- Auto-refresh every 5 seconds — open while training, watch it update\n\n```\nmltrackr.configure_watch(nan_check=True, divergence_window=5, plateau_window=15)\n\nwith mltrackr.run(\"training\"):\n    for epoch in range(100):\n        mltrackr.log(loss=compute_loss())\n        # Automatically warns if: loss → NaN, loss diverges for 5 epochs,\n        # loss plateaus for 15 epochs (and suggests adjusting LR)\n```\n\nStop wasting GPU hours on runs that are already failing.\n\n```\nmltrackr suggest accuracy\n```\n\nAnalyzes your run history and tells you which hyperparameter values are statistically correlated with better results. No black box — plain English insights like:\n\n```\nBest config: lr=0.001 → avg accuracy 0.943 (vs 0.871 for other values, +8.2%)\nNext experiment: try batch_size=128 — larger batches correlated with +5.1% accuracy\nmltrackr report --output results.md\n```\n\nGenerates a thesis-ready markdown report with:\n\n- Summary statistics (total runs, completion rate, best configurations)\n- Chronological experiment timeline\n- Key findings (computed automatically)\n- Notes from all your runs\n- Optional AI narrative:\n`mltrackr report --ai`\n\n(uses local Ollama, no API keys)\n\n```\nmltrackr init                           # plain Python example\nmltrackr init --framework pytorch       # PyTorch training loop\nmltrackr init --framework sklearn       # scikit-learn grid search\nmltrackr init --framework keras         # Keras callback\n```\n\nGenerates a complete working script you can run immediately.\n\n| Framework | How |\n|---|---|\nPyTorch |\n`mltrackr.log(loss=loss.item(), acc=acc)` inside the training loop |\nscikit-learn |\n`mltrackr.log(**params, cv_score=score)` in your hyperparam loop |\nKeras / TF |\nOne-file `TrainlogCallback` for `model.fit()` |\nHuggingFace |\nCustom `TrainerCallback` — see `examples/huggingface_example.py` |\nXGBoost / LightGBM |\nLog in the eval callback |\nJAX / Flax |\nLog at end of each training step |\nPlain Python |\nAnything that produces a number |\n\n``` python\nimport mltrackr\n\n# ── Tracking ──────────────────────────────────────────────────────────────────\nwith mltrackr.run(\"name\", tags=[\"tag1\", \"tag2\"]) as run_id:\n    mltrackr.log(accuracy=0.95, loss=0.05)          # log any key-value pairs\n    mltrackr.note(\"Cosine LR schedule helped a lot\") # attach plain-text notes\n\nmltrackr.tag(run_id, \"production\")       # add tags after the fact\nmltrackr.tag(\"experiment-name\", \"best\")  # also works by name\n\n# ── Querying ──────────────────────────────────────────────────────────────────\nruns = mltrackr.get_runs()                           # all runs, newest first\nbest = mltrackr.get_best_run(\"accuracy\")             # highest final value\nbest_low = mltrackr.get_best_run(\"loss\", mode=\"min\") # lowest final value\ncmp = mltrackr.compare_runs(1, 2, 3)                 # list of run dicts\n\n# ── Anomaly detection ─────────────────────────────────────────────────────────\nmltrackr.configure_watch(\n    nan_check=True,           # warn on NaN/Inf values\n    divergence_window=5,      # warn if metric diverges for N steps\n    plateau_window=15,        # warn if metric plateaus for N steps\n    enabled=True,\n)\n\n# Or temporarily with a context manager:\nwith mltrackr.watch(divergence_window=3):\n    # stricter watch for this block\n    mltrackr.log(loss=0.5)\n\n# ── Export & analysis ─────────────────────────────────────────────────────────\nmltrackr.export_csv(\"results.csv\")\nmltrackr.export_json(\"results.json\")\nmltrackr.generate_report(\"report.md\", use_ollama=False)\nsuggestions = mltrackr.suggest(\"accuracy\", mode=\"max\", top_n=3)\nmltrackr.clear_all()  # deletes everything (irreversible)\n\n# ── Config ────────────────────────────────────────────────────────────────────\nmltrackr.configure(verbose=False)  # suppress auto-summary panels after each run\n# Dashboard\nmltrackr ui                             # open at localhost:7000\nmltrackr ui --port 8080 --no-browser    # custom port, no auto-open\n\n# Inspect runs\nmltrackr list                           # rich table, newest first\nmltrackr list --limit 50\nmltrackr compare 1 2 3                  # side-by-side metric comparison\nmltrackr best accuracy                  # best run for a metric\nmltrackr best loss --mode min\n\n# Annotate\nmltrackr tag 42 production tuned        # add tags to run #42\nmltrackr note 42 \"Try cosine annealing\" # add note to run #42\n\n# Analyse\nmltrackr stats                          # aggregate statistics\nmltrackr suggest accuracy               # hyperparameter recommendations\nmltrackr suggest loss --mode min --top 5\n\n# Generate\nmltrackr report                         # write report.md\nmltrackr report -o results.md --ai      # with Ollama AI narrative\nmltrackr init --framework pytorch       # generate example script\n\n# Export / clean\nmltrackr export --format csv -o data.csv\nmltrackr export --format json -o data.json\nmltrackr clear                          # delete all (asks confirmation)\n\n# Share\nmltrackr share accuracy                 # generate Twitter/X + HN ready post\nmltrackr share loss --mode min          # for metrics where lower is better\n```\n\n**SQLite**—`~/.mltrackr/experiments.db`\n\n. One file. No server. Inspect it with any SQLite browser. Back it up with`cp`\n\n.**Flask**— the dashboard is a local Flask server. Vanilla JS, Chart.js, zero npm, zero build step.** Thread-local state**— each training job in its own thread gets an isolated run context. Concurrent experiments just work.** Git-aware**— captures the current commit hash via`git rev-parse HEAD`\n\n. Silently skipped outside a git repo.**Watch hooks**— anomaly detection runs inside every`log()`\n\ncall. Zero external services, works offline.\n\n```\nmltrackr init --framework pytorch -o train.py\npython train.py\nmltrackr ui\n```\n\nThat's the whole flow. Five commands. Zero config.\n\n**Done ✅**\n\n- Live anomaly detection (\n`configure_watch`\n\n) - Auto-generated experiment reports (\n`mltrackr report`\n\n, Ollama support) - Hyperparameter suggestions (\n`mltrackr suggest`\n\n) - Quick-start example generator (\n`mltrackr init`\n\n) - Sparkline charts in sidebar with trend indicators\n- Metric progress bars and trend arrows in detail view\n- Framework examples: PyTorch, scikit-learn, Keras, HuggingFace\n\n**Coming up**\n\n-\n`mltrackr.log_artifact(\"model.pt\")`\n\n— save file paths alongside metrics - Native PyTorch\n`TrainlogCallback`\n\n(pip-installable plugin) - VS Code extension — inline run summary on hover\n-\n`mltrackr serve`\n\n— shareable read-only dashboard URL (ngrok/localtunnel) - Team sync via shared git-tracked SQLite\n- Slack / Discord webhook on run completion\n\nHave an idea? [Open a feature request](https://github.com/NaiaLorente/Datalog/issues/new) — or submit a PR.\n\nSee [CONTRIBUTING.md](/NaiaLorente/datalog/blob/main/CONTRIBUTING.md). TL;DR: `pip install -e .`\n\n, make your change, open a PR.\n\nAll contributions welcome — typos, docs, features, bug fixes.\n\nMIT — use it however you want, forever.", "url": "https://wpnews.pro/news/mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account", "canonical_source": "https://github.com/NaiaLorente/datalog", "published_at": "2026-06-30 12:07:55+00:00", "updated_at": "2026-06-30 12:20:38.863608+00:00", "lang": "en", "topics": ["machine-learning", "developer-tools", "mlops"], "entities": ["mltrackr", "MLflow", "Weights & Biases", "GitHub", "SQLite"], "alternates": {"html": "https://wpnews.pro/news/mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account", "markdown": "https://wpnews.pro/news/mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account.md", "text": "https://wpnews.pro/news/mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account.txt", "jsonld": "https://wpnews.pro/news/mltrackr-ml-experiment-tracking-in-2-lines-no-server-no-account.jsonld"}}