Sign inSign up

longkeyy/ollama-ui

By longkeyy

•Updated about 1 year ago

Ollama model management platform with API gateway.

Image
Machine learning & AI
0

2.1K

longkeyy/ollama-ui repository overview

⁠Ollama Remote Management Platform - Docker Deployment

šŸš€ Comprehensive Docker deployment guide for Ollama Remote Management Platform

ā šŸŽÆ Overview

This guide provides detailed instructions for deploying Ollama Remote Management Platform using Docker. The platform is designed for remote Ollama model management with secure API access and comprehensive compatibility.

⁠✨ Core Capabilities

⁠🌐 Remote Management
  • Centralized Control: Manage Ollama models remotely through web interface
  • Multi-Instance Support: Connect and manage multiple Ollama servers
  • Real-time Monitoring: Live performance metrics and resource tracking
  • Secure Access: API key authentication for remote operations
ā šŸ”Œ API Compatibility
  • OpenAI Compatible: Drop-in replacement for OpenAI API endpoints
  • Claude Compatible: Optimized for claude-code integration
  • Unified Interface: Single platform supporting multiple API formats
  • Request Routing: Intelligent routing based on client requirements
ā šŸ›”ļø Security & Access Control
  • API Key Management: Secure remote access with customizable keys
  • Multi-user Support: Role-based permissions and user management
  • Session Control: Secure authentication and session management
  • Access Logging: Comprehensive audit trails
ā šŸŽØ Web Interface
  • Responsive Design: Optimized for desktop and mobile devices
  • Real-time Updates: Live streaming chat responses and model status
  • Multi-language Support: International user interface
  • Customizable Themes: Dark/light mode with automatic detection

⁠🐳 Docker Image Versions

⁠Standalone Version (Remote Management Only)

Perfect for connecting to existing Ollama servers with minimal resource usage.

# Pull the latest standalone version
docker pull longkeyy/ollama-ui:0.0.1
⁠All-in-One Version (Complete Solution)

Includes both the management platform and Ollama runtime for single-server deployment.

# CUDA/CPU version
docker pull longkeyy/ollama-ui:0.0.1-0.11.8

# AMD ROCM version
docker pull longkeyy/ollama-ui:0.0.1-0.11.8-rocm

ā šŸš€ Quick Deployment

⁠Standalone Deployment (Connect to Existing Ollama)

Perfect for users who already have Ollama running elsewhere:

# Basic standalone deployment
docker run -d \
  --name ollama-remote \
  -p 8083:8083 \
  -v ollama-data:/app/data \
  longkeyy/ollama-ui:0.0.1

# Connect to remote Ollama server
docker run -d \
  --name ollama-remote \
  -p 8083:8083 \
  -e OLLAMA_API_BASE_URL=http://your-ollama-server:11434 \
  -e API_KEY_REQUIRED=true \
  -v ollama-data:/app/data \
  longkeyy/ollama-ui:0.0.1
⁠All-in-One Deployment (Complete Solution)

Recommended for new users who want everything in one container. The All-in-One version exposes the web interface on port 11434, making it a drop-in replacement for standard Ollama:

# CPU version
docker run -d \
  --name ollama-complete \
  -p 11434:11434 \
  -v ollama-models:/root/.ollama \
  -v ollama-data:/app/data \
  longkeyy/ollama-ui:0.0.1-0.11.8

# GPU version (NVIDIA CUDA)
docker run -d \
  --name ollama-complete-gpu \
  --gpus all \
  -p 11434:11434 \
  -v ollama-models:/root/.ollama \
  -v ollama-data:/app/data \
  longkeyy/ollama-ui:0.0.1-0.11.8

# AMD ROCM version
docker run -d \
  --name ollama-complete-rocm \
  --device=/dev/kfd --device=/dev/dri \
  --security-opt seccomp=unconfined \
  -p 11434:11434 \
  -v ollama-models:/root/.ollama \
  -v ollama-data:/app/data \
  longkeyy/ollama-ui:0.0.1-0.11.8-rocm

ā šŸ“‹ Docker Compose Examples

⁠Standalone with External Ollama
version: '3.8'

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama-server
    ports:
      - "11434:11434"
    volumes:
      - ollama-models:/root/.ollama
    environment:
      - OLLAMA_HOST=0.0.0.0:11434
    restart: unless-stopped

  ollama-ui:
    image: longkeyy/ollama-ui:0.0.1
    container_name: ollama-remote-ui
    ports:
      - "8083:8083"
    volumes:
      - ollama-data:/app/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
      - API_KEY_REQUIRED=true
      - DEFAULT_MODEL=llama2:7b
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama-models:
  ollama-data:
⁠All-in-One Complete Solution
version: '3.8'

services:
  ollama-complete:
    image: longkeyy/ollama-ui:0.0.1-0.11.8
    container_name: ollama-complete
    ports:
      - "11434:11434"  # Single port for both API and Web UI
    volumes:
      - ollama-models:/root/.ollama
      - ollama-data:/app/data
    environment:
      - OLLAMA_HOST=0.0.0.0:11434
      - OLLAMA_UI_PORT=11434  # WebUI also uses port 11434
      - API_KEY_REQUIRED=true
    restart: unless-stopped
    # GPU support (uncomment for NVIDIA GPU)
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: all
    #           capabilities: [gpu]

volumes:
  ollama-models:
  ollama-data:

ā āš™ļø Environment Variables

⁠Core Configuration

All configuration options can be set via environment variables with the WEBUI_ prefix:

VariableDefaultDescription
WEBUI_SERVER_PORT8080 (standalone) / 11434 (AIO)Web interface port
WEBUI_SERVER_HOST0.0.0.0Server listening address
WEBUI_OLLAMA_URLhttp://localhost:11434Ollama API endpoint
WEBUI_OLLAMA_TIMEOUT300sOllama request timeout
⁠Authentication Settings
VariableDefaultDescription
WEBUI_AUTH_USERNAMEadminDefault login username
WEBUI_AUTH_PASSWORDadmin123Default login password (āš ļø Change immediately!)
WEBUI_AUTH_JWT_SECRETyour-secret-key-change-in-productionJWT secret key
WEBUI_AUTH_TOKEN_EXPIRE3600Token expiration time (seconds)
⁠Download Manager Settings
VariableDefaultDescription
WEBUI_DOWNLOADS_MAX_CONCURRENT3Max concurrent downloads
WEBUI_DOWNLOADS_QUEUE_SIZE10Download queue size
WEBUI_DOWNLOADS_RETRY_ATTEMPTS3Retry attempts on failure
WEBUI_DOWNLOADS_RETRY_DELAY5sDelay between retries
⁠Logging Configuration
VariableDefaultDescription
WEBUI_LOGGING_LEVELinfoLog level (debug, info, warn, error)
WEBUI_LOGGING_FORMATjsonLog format (json, text)
WEBUI_LOGGING_FILEollama-webui.logLog file path
⁠Ollama Configuration (All-in-One Version)

In the All-in-One version, Ollama runs internally and is not exposed:

VariableDefaultDescription
OLLAMA_HOST127.0.0.1:11435Ollama internal address (protected)
OLLAMA_MODELS/root/.ollama/modelsModel storage directory
OLLAMA_PRELOAD_MODELS(optional)Comma-separated models to preload

ā šŸ”§ Data Persistence

⁠Important Directories
  • /root/.ollama: Ollama models and configuration (All-in-One version)
  • /app/data: Platform data, user settings, API keys, chat history
  • /var/log/supervisor: Service logs (All-in-One version)
⁠Backup and Restore
# Backup platform data
docker run --rm -v ollama-data:/source -v $(pwd):/backup alpine \
  tar czf /backup/platform-data-backup.tar.gz -C /source .

# Backup models (All-in-One version)
docker run --rm -v ollama-models:/source -v $(pwd):/backup alpine \
  tar czf /backup/models-backup.tar.gz -C /source .

# Restore platform data
docker run --rm -v ollama-data:/target -v $(pwd):/backup alpine \
  tar xzf /backup/platform-data-backup.tar.gz -C /target

# Restore models
docker run --rm -v ollama-models:/target -v $(pwd):/backup alpine \
  tar xzf /backup/models-backup.tar.gz -C /target

⁠🌐 Access and Usage

⁠Initial Setup
  1. Access the Platform:

    • Standalone: http://localhost:8083
    • All-in-One: http://localhost:11434
  2. Default Login Credentials:

    • Username: admin
    • Password: admin123

    āš ļø IMPORTANT: Please change the default password immediately after first login!

  3. Change Default Password:

    # Set new credentials via environment variables
    docker run -d \
      -e AUTH_USERNAME=your_username \
      -e AUTH_PASSWORD=your_secure_password \
      # ...other parameters
    

    Or via configuration file config.yaml:

    auth:
      username: "your_username"
      password: "your_secure_password"
    
  4. API Key Setup: Configure API keys for remote access

  5. Model Management: Install your first models

⁠API Endpoints

OpenAI Compatible:

  • GET /v1/models - List available models
  • POST /v1/chat/completions - Chat completions
  • POST /v1/embeddings - Text embeddings

Claude Compatible:

  • POST /v1/claude/messages - Claude-style messaging
  • GET /v1/claude/models - Claude model list
⁠Usage Examples
# OpenAI-style chat
curl -X POST http://localhost:8083/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "model": "llama2:7b",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": false
  }'

# Claude-style messaging
curl -X POST http://localhost:8083/v1/claude/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "model": "llama2:7b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

ā šŸ” Troubleshooting

⁠Common Issues

1. Cannot access the web interface

# Check container status
docker ps -a
docker logs ollama-remote

# Verify port accessibility
netstat -tulpn | grep :8083

2. API authentication failures

# Check API key configuration
docker exec ollama-remote cat /app/data/config.yaml

# Verify API key in requests
curl -H "Authorization: Bearer your-key" http://localhost:8083/v1/models

3. Ollama connection issues

# Test Ollama connectivity (All-in-One)
curl http://localhost:11434/api/version

# Test external Ollama (Standalone)
docker exec ollama-remote curl $OLLAMA_API_BASE_URL/api/version

4. Model download problems

# Check available disk space
docker exec ollama-remote df -h

# Monitor download progress
docker logs -f ollama-remote
⁠Performance Optimization

Memory Management:

# Limit container memory
docker run -d --memory=8g --memory-swap=12g \
  # ... other parameters

CPU Allocation:

# Limit CPU usage
docker run -d --cpus=4.0 --cpu-shares=2048 \
  # ... other parameters

GPU Optimization:

# Check GPU availability
docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

# Monitor GPU usage
docker exec ollama-complete nvidia-smi

ā šŸ“Š Monitoring and Logging

⁠Health Checks
# Platform health check
curl -f http://localhost:8083/health || echo "Platform unhealthy"

# API health check
curl -f http://localhost:8083/v1/models || echo "API unhealthy"

# Ollama service health (All-in-One)
curl -f http://localhost:11434/api/version || echo "Ollama unhealthy"
⁠Log Management
# View platform logs
docker logs -f ollama-remote

# View specific service logs (All-in-One)
docker exec ollama-complete supervisorctl status
docker exec ollama-complete tail -f /var/log/supervisor/ollama.log

ā šŸ”„ Updates and Maintenance

⁠Update to Latest Version
# Stop current container
docker stop ollama-remote
docker rm ollama-remote

# Pull latest image
docker pull longkeyy/ollama-ui:0.0.1-0.11.8

# Restart with same configuration
docker run -d \
  --name ollama-remote \
  # ... same parameters as before
  longkeyy/ollama-ui:0.0.1-0.11.8
⁠Version Migration
# Export current configuration
docker exec ollama-remote cat /app/data/config.yaml > config-backup.yaml

# Import to new version
docker cp config-backup.yaml ollama-remote:/app/data/config.yaml

⁠🌟 Advanced Features

⁠API Gateway Configuration
# Enable load balancing across multiple Ollama instances
docker run -d \
  --name ollama-gateway \
  -p 8083:8083 \
  -e OLLAMA_BACKENDS="http://ollama1:11434,http://ollama2:11434" \
  -e LOAD_BALANCE_STRATEGY="round_robin" \
  longkeyy/ollama-ui:0.0.1
⁠Multi-Architecture Support
# Explicitly pull for specific architecture
docker pull --platform linux/amd64 longkeyy/ollama-ui:0.0.1-0.11.8
docker pull --platform linux/arm64 longkeyy/ollama-ui:0.0.1-0.11.8

ā šŸ—ļø Architecture

⁠All-in-One Architecture (Protected Ollama)
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│        ollama-allinone Container            │
│                                              │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│  │ Ollama (Internal) │←─│ WebUI (Public)  │ │
│  │ 127.0.0.1:11435   │  │ 0.0.0.0:11434   │ │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
│         ↑                        ↓           │
│         └──── Protected ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜           │
│                                              │
│      Supervisor Process Manager              │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
        External Access: Port 11434 Only
⁠Standalone Architecture
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ ollama       │     │ ollama-ui    │
│ Container    │←────│ Container    │
│ :11434       │     │ :8083        │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

ā šŸ¤ Support & Community


šŸ’” Ready to deploy? Start with our recommended All-in-One deployment for the complete experience!

Tag summary

Content type

Image

Digest

sha256:72e7f4bcc…

Size

1.1 GB

Last updated

about 1 year ago

docker pull longkeyy/ollama-ui