Skip to main content
Use Ollama for quick local model serving with a simple CLI or Docker-based deployment.
Ollama uses GGUF models and supports GPU acceleration (CUDA, Metal, ROCm).
The official Ollama v0.17.0 (latest stable) from ollama.com fails with a missing tensor 'output_norm.weight' error on the lfm2moe architecture. This affects all LFM MoE models (e.g. LFM2-24B-A2B, LFM2-8A-A1B). To run any LFM MoE model you specifically need v0.17.1-rc0 or later.

Installation

Download directly from ollama.com/download.

Using LFM2 Models

Ollama can load GGUF models directly from Hugging Face or from local files.

Running GGUFs

You can run LFM2 models directly from Hugging Face:
See the Models page for all available GGUF repositories. To use a local GGUF file, first download a model from Hugging Face:
Replace {quantization} with your preferred quantization level (e.g., q4_k_m, q8_0). Then run the local model:
For custom configurations (specific quantization, chat template, or parameters), create a Modelfile.Create a plain text file named Modelfile (no extension) with the following content:
Import the model with the Modelfile:
Then run it:

Basic Usage

Interact with models through the command-line interface.

Interactive Chat

Type your messages and press Enter. Use /bye to exit.

Single Prompt

If you imported a model with a custom name using a Modelfile, use that name instead (e.g., ollama run my-model).

Serving Models

Ollama automatically starts a server on http://localhost:11434 with an OpenAI-compatible API for programmatic access.

Python Client

Ollama provides two native API endpoints:Generate API (simple completion):
Chat API (conversational format):

Vision Models

LFM2-VL GGUF models can also be used for multimodal inference with Ollama.
Run a vision model directly and provide images in the chat:
In the interactive chat, you can ask questions about images using the /image command followed by the file path:
Or provide the image path directly in your prompt:

Model Management

List installed models:
Remove a model:
Show model information: