MLX LM is useful for a short, repeatable Terminal test. You don’t need to start an HTTP server just to run one prompt.
Install on Mac
Check that your Python runs natively. On an M-series Mac, run the check below with the same Python you plan to use for the virtual environment.
python3 -c 'import platform; print(platform.machine())'
If it prints arm64, continue below. If it prints x86_64 and About This Mac shows an Apple chip, use a native arm64 Python and create a fresh virtual environment with it. Recheck the command first: activating an existing virtual environment won’t change the architecture of its Python. If About This Mac shows an Intel processor, this MLX LM setup does not apply. The MLX 0.32.5 release ships macOS wheels for arm64 only. See the official MLX prerequisites for supported Python and macOS versions.
Terminal route, Apple Silicon. With compatible Python 3 installed, run the following in a new or empty working folder. The virtual environment keeps this guide’s dependencies separate from your system Python. The model files must be downloaded separately before you try the offline command.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install mlx-lm
mlx_lm.generate --help
Set it up
In a Python environment, follow the official installation directions for the mlx-lm package. Pick a compatible MLX model; allow the initial download online, or point the command at a complete MLX model directory you already have. Run one short text prompt.
mlx_lm.generate --model /path/to/local-mlx-model --prompt 'Suggest three titles for a photo album.'
Check that it works
After a successful setup, repeat with a new Terminal window and the same local model folder. If the new window fails before it reaches the model, confirm that you activated the environment and are using its arm64 Python. If Python starts and the weights fail to open, inspect the model folder instead.
Run the same command against the local folder after disconnecting, with a different prompt. If it cannot open the model, confirm the directory contains its configuration, tokenizer and weights. A lone GGUF file is not a substitute for the MLX directory in this example.
Prove the right Python and the right model are both in use
In the Terminal window you will use for the trial, record the interpreter path along with its architecture check. After activating your virtual environment, check that the shell still points to the expected Python and that the MLX LM command is found there. If the command fails before it opens a model, read that error first. A missing entry point and an unsupported wheel are environment problems. Fix the environment before repeatedly downloading weights.
Model selection has its own handoff. A Hub name can trigger a first download. A complete local model folder can be supplied to the model option after all required files are available. The MLX LM repository documents both model selection and conversion. Keep the folder intact when moving it and save its source and version with your test. The MLX route expects files supported by that runtime, so use a documented conversion or package if your only file is a GGUF.
Compare a connected run and a restart with local files only
First use a small instruction model and a prompt with an expected field, such as asking for the number in “Lantern order 0843.” Record whether the command completed and whether the result preserved the leading zero. Then close the terminal, disconnect the internet connections you control, open a fresh window and activate the same environment. Point it at the same already available local model and ask about a fresh example, such as “Cedar order 0051.” Check the new result before interpreting a successful process launch.
If the offline command complains about a missing model or tokenizer file, inspect the path and download completeness. If it fails importing the package, check the activated environment and architecture. If it starts generation but leaves the field blank, retain the output and distinguish the task error from an installation error. If changing software versions, note the old version and keep a separate environment until the new one passes the same checks. This gives you a working fallback and a clean record of which setup actually changed.
Make the Python environment and model paths reproducible
Start by naming the Python environment that belongs to the job. The official MLX install guide calls for a native Python on Apple silicon and lists macOS and Python version requirements. Check those against the machine and environment you opened. A new Terminal can activate a different environment from the one that installed MLX LM. Before retrying a model download, compare the interpreter and installed package information in the two shells.
To inspect the environment without generating text, use the existing environment you intend to use and run the following. Read the interpreter path, architecture and package details. If a project manages multiple environments, perform the same inspection in the shell that will actually launch the model.
python -c 'import platform, sys; print(sys.executable); print(platform.machine())'
python -m pip show mlx mlx-lm
If Python or the packages are absent in that shell, reopen or activate the intended environment and check again. Compare the installed versions with the project’s supported requirements. If the terminal command is still missing, check where that environment exposes its executables and rerun the installed command’s help. A model path error occurs later and does not get resolved by repeatedly installing the same package in a different environment.
Keep the files required by the selected package
Make a clear local directory for the MLX model you intend to use offline. Use the model publisher’s documented format and complete folder structure. Compare the local directory with the package listing for weights, configuration and tokenizer files where supplied. Some repositories include several artifacts for different runtimes. A folder name alone gives limited evidence about which format you saved. Record the actual repository version or revision and which files belong together.
Use the folder’s full path for the first working run, so a change of working directory does not alter which package is selected. If it sits on an external drive or in a synced folder, confirm that it is readable and present before you depend on it. During an offline rehearsal, keep the same local path. If the same command works with the downloaded directory but attempts to fetch files when given a repository identifier, keep those invocation styles separate in your record. The explicit directory helps establish the file path you can use without retrieval.
When a folder has been copied, confirm whether any required files are references to another place on disk. For a handoff, make sure the recipient can open the complete package from the location they received. Preserve the original package until the independent path is verified. If a loader reports a missing tokenizer or configuration file, compare its expected file with the documented package before trying unrelated flags.
Use a short task with a checkable result
Make a low-load practice case that matches the kind of reply you need. A model used for reminders could receive “Final departure: Wednesday 08:50 from Bay 3. Earlier note: Wednesday 09:05 from Bay 5.” Ask it to return the final time and bay in one line. If it gives 08:50 and Bay 3, you have evidence for that short extraction under the selected configuration. If it repeats the whole input or produces role markers, inspect the chosen variant and documented prompt or chat handling. Keep model format and input protocol as separate items.
Record when the command starts, when it finishes and which values the final text contains. If the model prints a long continuation with no answer, keep the output and choose a supported way to narrow the task. Check command help for the installed version before copying arguments from a different release. A successful small run gives a good baseline for comparing a more demanding task, especially if that task needs more input or an exact output structure.
Classify failures by the earliest thing you can observe
If Python cannot import the expected package, correct the environment first. If the program opens and cannot locate local files, inspect the path and package layout. If the file loads and the Mac reports a memory problem when the actual task begins, keep the original error and try a smaller supported model or shorter input while retaining a known answer. If a full reply contains the wrong value, record it as a task failure and check the source text. Each record points to a distinct next step.
For example, a second Mac can use your script and virtual environment instructions while the local weights folder is named differently. Ask the other user to set their own full model path and run the same harmless exercise. If the CLI help works and the weight path fails, check the artifact location before concluding that the versions differ. If both load and only the user’s longer prompt fails, compare the input and available resources independently of installation.
Verify the setup as a local-only restart
Close the shell and reopen the intended environment using the same steps a user would follow. Start from a different working directory and specify the saved absolute model path. With ordinary network connections disconnected where appropriate, use a new source value. Confirm that the model can produce the complete answer rather than reusing an earlier log. If the CLI needs to access a repository while disconnected, verify that the command specifies the intended local directory and that all files are present. Avoid overwriting your prior working environment during this check.
A cold run and a repeat can have different preparation times. If your daily work will use a new process for each request, include that startup in your usable answer timing. If you are evaluating task quality, keep the same input and expected fields and compare actual output. Record speed only with the observed boundary and selected model. A result that omitted one field or stopped early remains an incomplete result even when it printed quickly.
For a larger input, keep the target and ask for the same details from a longer realistic note. Verify that any earlier draft and final revision are still distinguished. If a short input succeeds and a larger one fails, keep a smaller verified excerpt for the urgent task while you inspect the model and context settings. If you move to another quantization, use the same small and larger checks. This makes it possible to see whether the lower resource configuration still preserves the information you require.
Save enough information to recover the last working version
Include the Python executable, architecture, package versions, copied artifact revision, exact local path and short answer key in a private work record. Add the startup command and how you checked the expected return. For shared notes, describe the folder structure and use a placeholder for paths that vary by user. If you choose to upgrade packages, keep a known working environment or a reproducible record of it before switching.
After an update, verify the environment first and then run the same known task. Only change one model or dependency when evaluating an isolated issue. If both change together, save the result as a new configuration and keep the old observation for comparison. This is especially helpful when a later offline start needs to establish whether a new dependency, model artifact or command option caused the difference.
Build a minimal failure example before asking for support
Retain a harmless prompt, the exact version information and the smallest startup error that reproduces in your environment. If a full pathname reveals a private folder, replace that part in a shared example while preserving the folder structure relevant to the issue. Include what did work, such as the help output or a successfully loaded small model. That distinction helps another person reproduce the failing layer without running your whole workload or needing access to your actual documents.
Compare two local environments without changing the model
For a controlled upgrade, first record the versions and executable that return the correct answer. In the candidate environment, point at the same read-only local model directory and run the same short task. Record which command help appears and how the candidate behaves when asked for the final time and bay. A successful installation message is useful preparation evidence. The new environment is ready for this job when it can load the intended model and return both expected values in the allowed shape.
If the original environment can load the folder and the candidate cannot, compare the package versions and the exact load error before downloading the weights again. If both load and only the candidate gives a different reply, check any defaults relevant to prompt handling that the installed commands expose. Keep the actual request and complete output with the version record. When you explicitly change the input or generation settings, treat that as a new comparison with its own expected values.
Include a known local task in a script handoff
Give the recipient a separate working folder for their own local paths and a copy of the harmless input. If the script uses a relative path, document which directory it must run from or use a clearly supplied absolute path. Have them record the interpreter and model folder they actually use. When the CLI returns the expected text, run the consumer that will save or use the result. Check the saved fields and actual filename in that person’s environment.
For a longer processing task, choose one small excerpt with a known revision and one representative input that includes a near match. Decide what the output should preserve before running either. If the longer input loses the final value, label that as a context or behavior question and retain the short case as the supported route. The exact expected results make later environment comparisons useful even when timing varies.
Keep download state and startup conditions visible
A local path can lead to a directory that exists while still missing a critical file. When preparing for offline use, open the local folder from the environment that will run the command and compare it with the original package listing. Make sure no file required for the tested path is only present in a temporary source directory or on an unattached volume. Try a fresh local process after disconnecting if you need to rely on that start. A cached output from an earlier process demonstrates less than a new answer to a new input.
If someone reports that the workflow only runs online, get the precise step that attempts a network operation. A setup that resolves a repository ID may behave differently from a local folder invocation. If the complete folder works on both machines, retain the explicit local invocation and document how the folder was prepared. If it fails after copying, check the package files and links before opening a model compatibility issue.
Who built it
Apple’s MLX project publishes MLX LM under ml-explore. PyPI records MLX LM v0.0.2 on January 12, 2024, an early public package release, not necessarily the first public availability or the start of the MLX team.