Skip to main content

llm-omlx

llm-omlx is a plugin for LLM that discovers and uses text, vision, and embedding models served by oMLX. It uses oMLX's OpenAI-compatible API while presenting every model through LLM's public interfaces.

Installation

Install the plugin into the same environment as LLM:

llm install llm-omlx

Point it at one oMLX server. When OMLX_API_BASE is unset, the plugin reads the host and port from the local oMLX settings.json (under OMLX_BASE_PATH, default ~/.omlx), so a server managed by the oMLX app on the same machine works with no configuration. The API key is optional when the server allows unauthenticated requests:

export OMLX_API_BASE=http://127.0.0.1:8000/v1  # optional when oMLX runs locally
export OMLX_API_KEY=your-key  # optional

You can also store a key under LLM's omlx alias or provide --key for an individual command. Explicit keys take precedence over the stored alias and environment variable.

Usage

Refresh discovery and list the canonical omlx/ model IDs:

llm omlx models --refresh
llm models | grep '^omlx/'

Run text and vision prompts, or create an embedding:

llm -m omlx/your-model "Hello"
llm -m omlx/your-vlm -a image.png "Describe this image"
llm embed -m omlx/your-embedding-model -c "Embed this"

Model IDs come directly from the configured server and are always exposed as omlx/<provider-id>.

Discovery and offline behavior

The plugin first reads GET /v1/models/status. Models classified by oMLX as llm, vlm, or embedding are registered as text, vision, or embedding models respectively. Helper, hidden, reranker, audio, MarkItDown, and unknown special models are excluded.

If the status endpoint returns 404 or 405, discovery falls back to GET /v1/models. In that fallback catalogue, IDs containing embed (case-insensitive) are classified as embeddings; all other IDs become text-only chat models. Vision capability is never guessed from a model name.

A sanitized catalogue is cached in LLM's user directory for the configured API base. Fresh cache entries avoid repeated discovery. A matching stale cache can keep model listing usable when the server is offline; llm omlx models --refresh attempts the server first and uses the matching stale cache only if refresh fails. No model filesystem paths or raw status documents are persisted.

Model capabilities

Generation models support streaming, reasoning parts, conversations, tools, and structured JSON schemas. Actual tool calling and schema enforcement still depend on the selected model, its chat template, and the oMLX grammar configuration.

Only models classified as vlm accept attachments. Supported image MIME types are:

  • image/png
  • image/jpeg
  • image/gif
  • image/webp

Images may come from LLM-supported files, URLs, or bytes. Audio and video are not supported. Embedding models accept text only; binary and oMLX multimodal embedding items are not supported.

Configuration

Variable Default Purpose
OMLX_API_BASE local oMLX settings.json, else http://127.0.0.1:8000/v1 The single oMLX endpoint. A bare origin is normalized to end in /v1.
OMLX_BASE_PATH ~/.omlx Where the local oMLX settings.json is read from when OMLX_API_BASE is unset.
OMLX_API_KEY unset Optional oMLX API key.
OMLX_TIMEOUT 90 Positive request timeout in seconds.
OMLX_EMBED_BATCH_SIZE 32 Positive default batch size for embedding requests.

Development

The project requires Python 3.10 or later and uses uv:

uv sync --locked --all-groups
uv lock --check
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
uv build
uv run twine check dist/*

Live acceptance tests are skipped by default. With an oMLX server running:

OMLX_API_BASE=http://127.0.0.1:8000/v1 \
OMLX_API_KEY=your-key \
uv run pytest --run-live -m live -q

See CONTRIBUTING.md for the contribution workflow.

License

Apache-2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_omlx-0.1.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_omlx-0.1.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_omlx-0.1.0.tar.gz.

File metadata

  • Download URL: llm_omlx-0.1.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llm_omlx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82c22ef75194b7c14b6986d04f9fc7fde6341eb6409ef0458d1fa02567e02cbc
MD5 3a63927aebf27e244a5466f9fd27bfd0
BLAKE2b-256 afe3799a2ae776c19942d3568087b62ae79729b697bc0dc88a1ba871707066d7

See more details on using hashes here.

File details

Details for the file llm_omlx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_omlx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llm_omlx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91aaf4ec1b66dbd83e549e4be8a06f41e50477e128501fd6231d147c695c26f4
MD5 7ff0db8684873e3b9baefe4d54e54750
BLAKE2b-256 3d920885e858068ac772d0e77eb7715f43f4d1685c49faef415700b422aec224

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page