JustujuAI, layer by layer.Open in the interactive map

Layer 6 · Inference & Optimization

Running trained models quickly and cheaply for real users: serving, APIs, compression and caching.

In simple words: Getting answers out of a finished AI quickly and cheaply, for millions of people.

reviewed 2026-10-30

Like: A restaurant kitchen during service: the recipe is fixed, and now it's about getting many plates out fast and affordably.
Where it breaks: A kitchen cooks each order separately. Inference servers push many users' requests through the same model step together to use the hardware efficiently.

Key players

What it means for your business: This is where your per-request AI bill is set; a standard interface keeps switching providers cheap, and hosting open models yourself usually needs steady, high volume to pay off.

As of 2026-10-15. Sources: vLLM (GitHub) (2026); SGLang (GitHub) (2026); llama.cpp: LLM inference in C/C++ (GitHub) (2026); Ollama documentation: OpenAI compatibility (2024); Amazon Bedrock (2026); OpenRouter documentation: Quickstart (2024); Together AI (2026)

Security on this layer: 3 threats Pending expert review

Self-hosted model servers left open to anyone Pending expert review

Exposed
  • Model servers run on workstations and cloud machines, listening on all network interfaces
  • Their APIs, which by default often need no login
  • The compute, models and tool access those servers provide
Attacks
  • Scanning the internet for open model-server ports
  • Using someone else's server for free, or reselling its compute
  • Pulling, deleting or replacing models through the open API
Real case
Research demonstration: Over 1,100 exposed Ollama servers found with Shodan (Cisco Talos) (2025-09)
Controls
  • Bind model servers to localhost or a private network; never open them to the internet
  • Put an authenticating proxy or VPN in front of any shared model server
  • Scan your own address ranges for open model-server ports and keep servers patched
Owner
Platform/Cloud, with ML engineering
Reference
LLM06:2026 Unbounded Consumption
AML.T0132 Misconfigured or Publicly Exposed AI Services
AML.T0006.002 Scan for Exposed AI Infrastructure
AML.T0034 Cost Harvesting

Model files that run code when you load them Pending expert review

Exposed
  • Machines that download and load third-party model files
  • The credentials and data on those machines
Attacks
  • Hiding commands in pickle-based model files that run on load
  • Compressing or breaking the file in unusual ways so model-hub scanners miss the payload
Real case
Incident: Malicious models on Hugging Face (nullifAI) (2025-02)
Controls
  • Load weights only in formats that cannot run code, such as safetensors
  • Pin models by hash or signature, not by name alone
  • Load untrusted models in an isolated environment
Owner
ML engineering, with AppSec
Reference
LLM04:2026 Supply Chain
AML.T0011.000 Unsafe AI Artifacts
AML.T0010.003 Model Repository

Encrypted chat traffic still reveals the topic Pending expert review

Exposed
  • Streamed responses, sent token by token over encrypted connections
  • The sizes and timing of those packets, visible to anyone on the network path
Attacks
  • Training a classifier on packet sizes and timing to guess what a conversation is about
Real case
Research demonstration: Whisper Leak (2025-11)
Controls
  • Pad streamed chunks with random-length filler
  • Batch several tokens per packet
  • Offer a non-streaming mode for sensitive use
Owner
Platform/Cloud, with ML engineering
Reference
None verified

All layers in the security view

What it gives the layer above

A fast, affordable endpoint: send text in, get text out.

What it needs from the layer below

Model weights from Foundation Models and serving hardware from Cloud & Infrastructure.

Concepts

Walkthrough

  1. A coding question goes out. A coding tool sends “why does this test fail?” to a model API, perhaps through a router that picks a provider, and pays per token.
  2. The provider shares the work. On the provider's servers the question rides in a batch with many other users' requests, and the KV cache saves re-reading the long code file for every new token.
  3. Smaller numbers, more room. Quantized weights take less memory, leaving room for more users' caches in each batch.
  4. Or ask the same question at home. The same open model, quantized into a GGUF file, runs in a local runtime on a home GPU. The coding tool just points at localhost instead.
  5. A small helper speeds it up. With only one user at home, a small draft model guesses ahead and the big model checks its guesses, so the answer streams out sooner: identical under greedy decoding, and with the same odds when sampling.

Examples