Get in Touch

Course Outline

AI Sovereignty and Local Deployment of LLMs

  • Risks associated with cloud LLMs: issues related to data retention, potential use of inputs for training, and foreign jurisdictional controls.
  • Ollama architecture: understanding the model server, registry functionality, and OpenAI-compatible API structure.
  • Comparative analysis with vLLM, llama.cpp, and Text Generation Inference.
  • Overview of model licensing terms for Llama, Mistral, Qwen, and Gemma.

Installation and Hardware Configuration

  • Setting up Ollama on Linux systems with CUDA and ROCm support.
  • Implementing CPU-only fallback options and optimizing for AVX/AVX2 instructions.
  • Deploying via Docker and configuring persistent volume mappings.
  • Configuring multi-GPU environments and strategies for VRAM allocation.

Model Management

  • Downloading models from the Ollama registry using commands like 'ollama pull llama3'.
  • Importing GGUF format models sourced from HuggingFace and TheBloke repositories.
  • Evaluating quantization levels, such as Q4_K_M, Q5_K_M, and Q8_0, to balance performance and size.
  • Managing model switching and understanding limits on concurrent model loading.

Custom Modelfiles

  • Syntax structure for writing 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 enabling JSON mode.
  • Integrating local LLMs with frameworks like LangChain, LlamaIndex, and bespoke applications.
  • Implementing authentication and rate limiting via reverse proxy configurations.

Performance Optimization

  • Optimizing context window sizing and managing KV cache efficiency.
  • Executing batch inference and handling parallel requests effectively.
  • Allocating CPU threads and maintaining NUMA awareness.
  • Monitoring GPU utilization metrics and memory pressure levels.

Security and Compliance

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

Requirements

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

Target Audience

  • AI engineers and developers looking to substitute cloud LLM APIs with on-premises solutions.
  • Organizations handling sensitive data that restricts the use of cloud-based models.
  • Government and defense teams necessitating air-gapped language model capabilities.
 14 Hours

Number of participants


Price per participant

Upcoming Courses

Related Categories