Ollama is a local LLM serving platform written in Go. It provides a REST API (OpenAI-compatible), CLI, TUI chat, and desktop application for running large language models locally. The system supports multiple inference backends: llama.cpp (CPU/CUDA/ROCm/Vulkan) and MLX (Apple Silicon). It includes a model conversion pipeline from HuggingFace safetensors to GGUF format, GPU hardware discovery, and an agent framework with tool execution (bash, file operations, web search). The architecture is a monolith with subprocess management for inference backends. Key entry points include the CLI (main.go), HTTP server (server/routes.go), runner binary (cmd/runner/main.go), and desktop UI (app/ui/app/). The codebase is actively maintained with extensive test coverage and support for dozens of model architectures. While primarily an application, it has significant data/research components in model conversion, tokenization, and speculative decoding research.
SGLang is a high-performance inference serving system for large language models (LLMs) and multimodal models (vision, video, audio, diffusion). It provides an OpenAI-compatible API, a Python frontend DSL for programmable inference, and supports a wide range of hardware backends (NVIDIA CUDA, AMD ROCm, Intel XPU, Ascend NPU, Apple MLX). The architecture is a distributed serving runtime (SRT) with a scheduler, model executor, custom CUDA/Triton kernels, and advanced features like speculative decoding (EAGLE, MTP, NGRAM), disaggregated prefill/decode, hierarchical KV cache (HiCache), and quantization (FP8, NVFP4, AWQ, GPTQ). It also includes a Rust-based model gateway for routing and a multimodal generation pipeline for diffusion models. The system is designed for production-scale deployment, powering trillions of tokens daily across hundreds of thousands of GPUs.