mlx-optiq
Workflow · Lab

OptIQ Lab

A local web UI for everything you'd do with a model on your laptop: chat with it, compare two side by side, browse and load quants, quantize a new one, fine-tune a LoRA adapter, and build a dataset. One command boots the UI and an OpenAI-compatible API server together.

Install + launch

shellbash
pip install 'mlx-optiq[lab]'
optiq lab            # UI on :7860, API on :8080

First launch asks you to set a password (single user, Argon2-hashed, JWT session). The Lab binds to 127.0.0.1 unless you pass --host 0.0.0.0.

What's inside

  • Chat: streaming playground with local tools, self-healing tool calls, chat-with-files (RAG + citations), and a Canvas that renders HTML the model writes.
  • Model Arena: two models, one prompt, side by side, with tokens/sec.
  • Hub: browse published OptIQ quants, search Hugging Face, list local models, load any of them with one click.
  • Quantize: the sensitivity + knapsack + convert wizard.
  • Fine-tune: sensitivity-aware LoRA on any OptIQ quant.
  • Build dataset: turn pairs / docs / code / seeds into training JSONL.

Hugging Face token

Save a write-scope token once in Settings → Hugging Face and the Quantize / Fine-tune / Dataset workflows reuse it for one-click HF push. The token is encrypted at rest with a Fernet key derived from your Lab password.

HF settings

How it's structured

The Lab is a Flask app (optiq.lab.create_app) on its own port. optiq lab also boots mlx_lm.server in a daemon thread, so it's one process, two ports: UI on 7860, API on 8080. Background work (quantize, train, dataset generation) runs in multiprocessing.Process workers, progress streamed to the UI over SSE.

Why localhost-only by defaultThe Lab binds to 127.0.0.1 unless you explicitly pass --host 0.0.0.0. Password protection is enforced either way, but please don't expose it to the public internet; this is a local development tool, not a hosted service.