Get in Touch
 Duration 14 hours

Course Outline

AI Sovereignty and Local LLM Deployment

  • Risks associated with cloud LLMs: data retention policies, potential training on user inputs, and foreign jurisdictional constraints.
  • Ollama architecture: encompassing the model server, registry, and OpenAI-compatible API.
  • Comparative analysis with vLLM, llama.cpp, and Text Generation Inference.
  • 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 AVX/AVX2 optimizations.
  • Deploying via Docker and configuring persistent volume mappings.
  • Configuring multi-GPU setups and strategies for VRAM allocation.

Model Management

  • Retrieving models from the Ollama registry: e.g., ollama pull llama3.
  • Importing GGUF models from HuggingFace and TheBloke.
  • Tradeoffs associated with quantization levels: Q4_K_M, Q5_K_M, and Q8_0.
  • Model switching mechanisms and limits on concurrent model loading.

Custom Modelfiles

  • Syntax for Modelfiles: utilizing FROM, PARAMETER, SYSTEM, and TEMPLATE directives.
  • Tuning parameters such as temperature, top_p, and repeat_penalty.
  • Engineering system prompts to define role-specific behaviors.
  • Creating and publishing custom models to the local registry.

API Integration

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

Performance Optimization

  • Managing context window sizing and KV cache operations.
  • Optimizing batch inference and handling parallel requests.
  • Allocating CPU threads with NUMA awareness.
  • Monitoring GPU utilization and memory pressure metrics.

Security and Compliance

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

Requirements

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

Audience

  • AI engineers and developers looking to transition from cloud LLM APIs.
  • Organizations where data sensitivity protocols restrict the use of cloud models.
  • Government and defense teams requiring air-gapped language model solutions.

Upcoming Courses

Related Categories