# Mugi "stable" MLX stack for Settings → Revert to stable.
# These versions are validated to resolve together (pip can install in one pass).
#
# The local model server is mlx-vlm's built-in OpenAI-compatible server
# (`python -m mlx_vlm.server`) — mlx-openai-server has been retired. mlx 0.31.2
# made GPU streams thread-local (mlx#3281/#3405), which broke mlx-openai-server's
# worker-thread handler; current stable is mlx 0.32.1 + mlx-vlm 0.6.13.
#
# Validated Jul 2026 on mlx 0.32.0 + mlx-vlm 0.6.5: text chat + native delta.tool_calls
# on Qwen3.6 and Gemma 4, streaming tool_calls, continuous batching concurrency,
# embeddings; vision/LoRA not re-soaked. Re-soaked Aug 21 2026 on mlx 0.32.1 +
# mlx-vlm 0.6.13 + transformers 5.14.1 (Qwen3.8-27B-8bit): plain chat, native
# search_memory tool_calls (finish_reason=tool_calls), 3-way concurrent streaming
# completions, in-process bge-small embeddings (dim=384). Vision/LoRA still not
# re-soaked.
#
# transformers is PINNED (not floating) because mlx-embeddings loads in-process from
# THIS venv; a transformers major bump can break knowledge/session embeddings at runtime.
# It also has a hard floor from mlx-vlm (0.6.5+ requires transformers>=5.14.0). Pinning
# it below that floor made this file unresolvable (ResolutionImpossible, Aug 2026),
# which silently disabled BOTH Revert to stable and the migration described below —
# re-run `pip install --dry-run -r requirements-mlx-pinned.txt` after touching either.
#
# Bump this file as a SET, never one line: the migration installs the whole file, so a
# package left behind at an older pin is *downgraded* on anyone who ran Update stack.
#
# Bump only after on-device testing (vision + text + tool calls). The floating
# requirements-mlx.txt may track newer releases; this file is the escape hatch.
# Shipping a newer pin also auto-migrates existing ~/.mugi/mlx-venv installs on
# ensure_mlx_venv / start_mlx_server when they are *behind* these exact pins. Nothing
# is touched while every package is at or above the pin — but see the set-bump note
# above: once one package is behind, the whole-file install pulls the rest back too.
# Deeper rollback to the retired mlx-openai-server stack: requirements-mlx-openai-legacy.txt.
mlx==0.32.1
mlx-metal==0.32.1
mlx-lm[train]==0.31.3
mlx-vlm==0.6.13
transformers==5.14.1
# Knowledge/session semantic search (separate from chat mlx-lm); required for vector index.
mlx-embeddings>=0.0.5,<0.2
