Ревью ML-сервера: PyTorch, Transformers и FastAPI
learning
runtime-skills is a Claude Code skill that provides best practices and code-review checklists for the Universal Runtime — LlamaFarm's local ML inference server exposing OpenAI-compatible endpoints for HuggingFace models. It covers four runtime-specific topics: PyTorch (device management, dtype selection, memory cleanup), Transformers (model loading, tokenization, inference), FastAPI (API design, streaming, lifespan handling), and Performance (batching, caching, optimizations), all building on top of the project's shared Python skill set. Key patterns documented inside include double-checked async locking for safe concurrent model loading, TTL-based model caching with automatic unloading of idle models after 5 minutes, device-aware tensor operations across CUDA, MPS, and CPU, and running blocking GGUF models via ThreadPoolExecutor. The skill is non-user-invocable and is applied automatically by Claude when reviewing or writing code under runtimes/universal/ on Python 3.11+.
- #pytorch
- #transformers
- #fastapi
- #inference
- #gpu
- #optimization