Get in Touch
 Duration 14 hours

Course Outline

AI Sovereignty and Local LLM Deployment

  • Assessing the risks associated with cloud LLMs: data retention, input training, and foreign jurisdiction issues.
  • Exploring Ollama’s architecture, including its model server, registry, and OpenAI-compatible API.
  • Comparing Ollama with alternatives such as vLLM, llama.cpp, and Text Generation Inference.
  • Reviewing model licensing terms for Llama, Mistral, Qwen, and Gemma.

Installation and Hardware Configuration

  • Installing Ollama on Linux with support for CUDA and ROCm.
  • Implementing CPU-only fallbacks and optimizing for AVX/AVX2.
  • Deploying via Docker with persistent volume mapping.
  • Configuring multi-GPU setups and managing VRAM allocation strategies.

Model Management

  • Fetching models from the Ollama registry using commands like 'ollama pull llama3'.
  • Importing GGUF models from HuggingFace and TheBloke.
  • Evaluating the tradeoffs of quantization levels such as Q4_K_M, Q5_K_M, and Q8_0.
  • Managing model switching and concurrent loading limits.

Custom Modelfiles

  • Mastering Modelfile syntax, including FROM, PARAMETER, SYSTEM, and TEMPLATE.
  • Tuning parameters like temperature, top_p, and repeat_penalty.
  • Engineering system prompts for role-specific behaviors.
  • Creating and publishing custom models to a local registry.

API Integration

  • Utilizing the OpenAI-compatible /v1/chat/completions endpoint.
  • Handling streaming responses and JSON mode.
  • Integrating with LangChain, LlamaIndex, and custom applications.
  • Implementing authentication and rate limiting using reverse proxies.

Performance Optimization

  • Managing context window sizing and KV cache efficiency.
  • Optimizing batch inference and parallel request handling.
  • Allocating CPU threads and ensuring NUMA awareness.
  • Monitoring GPU utilization and memory pressure.

Security and Compliance

  • Isolating networks for model serving endpoints.
  • Implementing input filtering and output moderation pipelines.
  • Maintaining audit logs for prompts and completions.
  • Verifying model provenance and hash integrity.

Requirements

  • Intermediate proficiency in Linux and container administration.
  • A high-level understanding of machine learning and transformer models.
  • Familiarity with REST APIs and JSON structures.

Target Audience

  • AI engineers and developers looking to substitute cloud LLM APIs with local solutions.
  • Organizations where data sensitivity restricts the use of cloud-based models.
  • Government and defense teams requiring air-gapped language model infrastructure.

Related Categories