๐Ÿฆ™ Ollama

Ollama allows you to run large language models (LLMs) locally on your own hardware. It supports popular models like Llama, Mistral, Gemma, and many more โ€” with a simple command-line interface and REST API for easy integration.

This container provides a self-hosted AI inference server that can be used by applications like Open WebUI, LibreChat, or any other OpenAI-compatible client.

๐Ÿท๏ธ Category: AI / LLM

๐Ÿณ Image: ollama/ollama


ย  ย 
๐Ÿ“ฆ Project github.com/ollama/ollama
๐Ÿ› Support GitHub Issues
๐Ÿ“– Docs ollama.com
๐Ÿ“š Library ollama.com/library

๐ŸŒ Ports

Port Protocol Description
11434 TCP Ollama API port โ€” used for model inference and management

๐Ÿ’พ Volumes

Host Path Container Path Description
/mnt/cache/appdata/ollama /root/.ollama Storage for downloaded models and configuration

โš™๏ธ Environment Variables

Variable Default Masked Description
OLLAMA_HOST 0.0.0.0:11434 โŒ Bind address for the Ollama API. Use 0.0.0.0 to accept connections from any IP
OLLAMA_MODELS /root/.ollama/models โŒ Path where models are stored inside the container
OLLAMA_ORIGINS `` โŒ Allowed CORS origins (comma-separated). Set to * to allow all origins
OLLAMA_KEEP_ALIVE 5m โŒ Duration to keep models loaded in memory after last request (e.g., 5m, 1h, 24h)
OLLAMA_NUM_PARALLEL 1 โŒ Number of parallel model requests to handle simultaneously
OLLAMA_MAX_LOADED_MODELS 1 โŒ Maximum number of models to keep loaded in memory at once
OLLAMA_FLASH_ATTENTION false โŒ Enable Flash Attention for faster inference on supported GPUs
OLLAMA_KV_CACHE_TYPE `` โŒ KV cache quantization type: f16, q8_0, q4_0 (reduces VRAM usage)
OLLAMA_GPU_OVERHEAD `` โŒ Reserve VRAM overhead (in bytes) for other GPU applications
OLLAMA_DEBUG false โŒ Enable debug logging for troubleshooting
TZ Europe/Vienna โŒ Timezone of the container, e.g. Europe/Vienna or Europe/Berlin
PUID 500 โŒ User ID for file permissions (MOS default: 500)
PGID 500 โŒ Group ID for file permissions (MOS default: 500)

๐Ÿš€ Quick Start

  1. Open the MOS Hub and search for Ollama
  2. Adjust the OLLAMA_ORIGINS variable if you need CORS access from specific domains
  3. For GPU support, ensure your host has NVIDIA Driver Plugin installed via MOS Hub
  4. Click Install
  5. Pull your first model:
docker exec -it ollama ollama pull llama3.2
  1. Test the API:
curl http://YOUR_HOST_IP:11434/api/generate -d '{
  "model": "llama3.2",
  "prompt": "Hello, how are you?"
}'

๐Ÿ”ง GPU Support (NVIDIA)

For NVIDIA GPU acceleration, ensure you have:

  1. NVIDIA Driver installed on your host via MOS Hub Plugin
  2. The container will automatically use available GPUs when properly configured.

Model Size Use Case
llama3.2 2-4 GB General purpose, fast responses
mistral 4-7 GB Good reasoning and instruction following
gemma2 3-9 GB Googleโ€™s efficient models
codellama 4-17 GB Code generation and completion
llava 4-7 GB Vision โ€” image understanding

๐Ÿ”— OpenAI-Compatible API

Ollama provides an OpenAI-compatible API endpoint at:

http://YOUR_HOST_IP:11434/v1/chat/completions

Use this URL in applications that expect an OpenAI API endpoint. No API key required!


โš ๏ธ Note: Downloaded models can be large (2-50+ GB). Ensure you have sufficient storage in your volume mount (/mnt/cache/appdata/ollama).

๐Ÿ’ก Tip: Use OLLAMA_KEEP_ALIVE=24h to keep models loaded and avoid reload delays during active usage periods.

๐Ÿ’ก Tip: For multiple concurrent users, increase OLLAMA_NUM_PARALLEL and OLLAMA_MAX_LOADED_MODELS accordingly.

๐Ÿ“š For more information: Visit the official Ollama documentation for details on all available models, API endpoints, and advanced configuration options.


MOS Templates โ€“ maintained by J000K3R

This site uses Just the Docs, a documentation theme for Jekyll.