AI Engineer World's Fair 2025
The Small Model Infrastructure Nobody Built (So We Did) — Filip Makraduli, Superlinked
Read the talk
The Small Model Infrastructure Nobody Built (So We Did)
Small models can make agent context more useful, but serving them efficiently requires architecture-aware execution, shared GPU capacity, and a production cluster that works with both.
From a talk by Filip Makraduli
Before you start: Familiarity with embeddings, transformer attention, and basic GPU serving will help with the runtime and infrastructure details.
What makes a model fast in production?
What is missing between understanding how a model computes and making it run efficiently in production? That is the problem behind Filip Makraduli’s work on small-model inference. He introduces it with a second, visual question: the patterned background of his slides represents something from machine learning. He offers a reward for identifying it, leaving the answer until the end.
The infrastructure question began with a Substack article. Makraduli had explained FlashAttention, model execution, and the difference between memory-bound and compute-bound work. Feedback exposed something the explanation had overlooked: inference as an operational system. His experience with vLLM, training, fine-tuning, applied ML, and academic research had not covered the whole path to production. GPU scheduling, routing, and automation are separate engineering problems from understanding the model.
To learn that part, he joined Superlinked’s infrastructure team and helped build the open-source Superlinked Inference Engine, or SIE. The soft launch presented here targets small models for AI search and document processing. Makraduli reports testing with Chroma, Qdrant, Weaviate, and LanceDB. The project connects model execution to the machinery needed to operate it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Small models before and inside the agent
The first question is why search and document-processing inference matters to agents. The next is what serving a model leaves unfinished. Those lead to the two halves of SIE’s design: model support and infrastructure, which Makraduli calls the yin and yang of inference.
The agent problem starts with context. Chroma’s Context Rot research shows that longer inputs can degrade performance under tested conditions; the effect varies across models and tasks. Small models provide a way to manage what reaches the agent: preprocess documents, select useful information, or expose a focused operation as a tool call. This also answers the objection that Claude Code and grep can already search files. Preprocessing can improve the files and information those tools search.
Several approaches fit this pattern:
- Structured knowledge: Makraduli points to Andrej Karpathy’s graph-based knowledge-base work. Named entity recognition can supply entities for ontology and knowledge-graph construction, or help organize a filesystem.
- Input filtering: He cites a Chroma model that preprocesses and filters input to manage context, alongside community tools that reduce token volume.
- Model-backed tools: In a production e-commerce use case, Makraduli reports using SIE for taxonomy classification. Small models become tools that retrieve and process data during the workflow, rather than only preparing it beforehand.
The common mechanism is to give the agent a more focused representation of the data it needs.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
More GPUs do not solve idle capacity
Adding compute is an incomplete answer when each model uses only a small part of a GPU. Makraduli describes Stella embedding models, rerankers, and the GLiNER named entity recognition model as occupying only a few gigabytes each, without specifying variants, precision, or workload memory. Giving every model its own GPU can leave both memory capacity and compute underused.
SIE instead supports swapping models on a shared GPU. A workflow can switch from one model-backed tool to another without reserving a separate GPU for each. Its least recently used eviction policy chooses which resident model to remove when capacity is needed: a model that has gone unused longer is evicted before a more recently used one. Makraduli reports higher utilization, lower costs, and quick switching, but supplies no measured utilization, cost, or switching-latency comparison.
Sharing a GPU still leaves the operational work around the server. TEI, vLLM, or an API wrapper can provide a starting point for inference, while the surrounding system needs routing, autoscaling, queues, GPU provisioning, and monitoring through Prometheus metrics and Grafana. Makraduli describes a gap in the open-source options available for connecting these pieces at the intended scale. SIE’s response is to supply the production infrastructure together with model serving.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The yin: models worth serving
Infrastructure is useful only if it supports the models a workload needs. Makraduli therefore starts the first half of the design with model breadth. He cites millions of models on Hugging Face in a March snapshot and estimates that the count could be approaching three million by the talk. That is an ecosystem-size argument: the available choices keep expanding, and users want access to them.
Makraduli cites MTEB and other benchmarks as evidence that open models can outperform managed services on narrow tasks. He also points to small Gemma models achieving higher Elo scores than much larger models. The presentation does not identify the tasks, model versions, baselines, or scores for these comparisons. Their role here is to motivate support for specialized models: choosing a smaller open model can be about suitability and quality as well as deployment control.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A shared API still needs different forward passes
Supporting hundreds of models is not simply a matter of loading different weights. BERT, Qwen, and ModernBERT differ in their architectures, attention implementations, and positional representations. SIE’s approach is to reimplement forward passes with the adaptations each architecture needs: attention handling, padding, variable-length execution, and query/key/value projection fusion where appropriate.
The output contract also changes what the runtime must preserve. ColBERT is a late-interaction model that produces multiple vectors, retaining token-level representations for subsequent matching. Cross-encoders and rerankers instead return scores rather than embedding vectors. A common serving layer therefore has to accommodate different result structures, not just different tensor sizes.
| Implementation concern | Difference the runtime must handle |
|---|---|
| Normalization | Model-specific normalization behavior |
| Q/K/V projections | Fusion choices and attention-head layout |
| Position | BERT absolute lookup; Qwen rotary embeddings |
| Attention | Architecture-specific execution and masking |
| Output | Embedding vectors, per-token vectors, or scores |
Makraduli’s comparison works through these differences across BERT, Qwen, and ColBERT. One qualification matters: he attributes a Qwen projection-fusion limitation to grouped-query attention, but grouped-query attention does not inherently prevent combined QKV projections. The Qwen2 implementation in vLLM v0.8.5 uses QKVParallelLinear. The relevant engineering task is adapting fusion to the model’s head layout and runtime, rather than assuming one fusion strategy works unchanged everywhere.
These differences require a consistent implementation process. SIE uses both agents and humans to implement the adapted forward passes, turning architectural knowledge into efficient model execution. Broad model support depends on preserving each model’s semantics while changing how its computation runs.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Stop spending attention work on padding
Variable-length FlashAttention addresses a concrete batching problem. Put a short request and a long request into a rectangular batch, and the short one may be padded to match the long one. Computation then includes empty positions introduced for the batch layout. Token-based batching needs an execution path that respects the actual sequence lengths, so padding does not consume unnecessary attention work.
For a small illustrative batch, take request A with token IDs [11, 12] and request B with [21, 22, 23, 24]. A rectangular representation gives A two padding slots. A packed representation retains [11, 12, 21, 22, 23, 24] and sequence boundaries [0, 2, 6]. Those boundaries are essential: removing padding must not allow one request’s tokens to attend to another request. The token contents stay the same; their storage and execution layout change.
Preserve request tokens while removing padding
Constructed example: Request names, token IDs, lengths, PAD notation, and boundary offsets are teaching values. Packed storage and boundaries illustrate the variable-length mechanism; they are not a captured SIE execution.
A = [11, 12]; B = [21, 22, 23, 24]
Operation: Replace the padded rectangular representation with packed tokens and sequence boundaries.
Request A tokens
[11, 12]
[11, 12]
Request B tokens
[21, 22, 23, 24]
[21, 22, 23, 24]
Token storage
[[11, 12, PAD, PAD], [21, 22, 23, 24]]
[11, 12, 21, 22, 23, 24]
Padding positions
Request A: slots 2 and 3
Not present
Packed sequence boundaries
Not present
[0, 2, 6]
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The yang: a cluster that can operate the models
The second half of the system is the cluster. Makraduli introduces a detailed architecture diagram but concentrates on the path through it rather than explaining every component. At this soft launch, the API is organized around three primitives: encode, score, and extract. Current SIE documentation includes additional generation capabilities; the three-operation interface is the one presented in the recording.
Requests pass through a router and a load-dependent queuing mechanism, which distribute work across pools of GPUs and other resources. Those pools can include spot instances and larger GPUs. KEDA autoscaling, driven by Prometheus metrics, connects observed demand to capacity changes. Hardware provisioning and model switching work together to keep available resources useful rather than leaving GPUs idle.
The integration is the product: users receive model support and cluster infrastructure together, instead of having to connect an inference engine to a separately assembled production stack. In the deployment workflow Makraduli describes, the operator selects models through configuration and applies the infrastructure:
bash
terraform apply
Published Helm charts and Docker images provide additional deployment artifacts. The command is the final application step for the configured infrastructure, not a replacement for selecting and configuring the deployment.
The release includes both sides of SIE: the adapted model execution code, including attention and forward-pass work, and the cluster machinery for provisioning and operating GPUs. This closes the gap that started with the FlashAttention article. Understanding how computation becomes fast inside a model now connects to controlling where that computation runs and how requests reach it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The pattern behind the slides
With the infrastructure explanation complete, Makraduli returns to the background puzzle. His hints point toward embeddings, attention, and transformer foundations. An audience member tentatively recalls a visualization in which embeddings clustered in part of the space because of positional encoding. Makraduli accepts the positional-encoding connection as the answer.
The reveal identifies the background as a vector visualization of sinusoidal positional encodings. The final slide pairs a green-and-blue heatmap with the orange striped pattern seen in the background. Makraduli connects the pattern to the way transformers represent token positions during training. In the original Transformer formulation, these sinusoidal encodings are fixed functions used during training, distinct from learned positional embeddings. The visual puzzle ends on the same architectural detail that mattered in model serving: how a model represents position is part of what its implementation must preserve.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Source code and current setup instructions for shared-model inference and its production cluster.
Further reading
Makraduli's explanation of memory traffic, FlashAttention, and embedding inference bottlenecks.
- Beyond Flash AttentionArticle
A companion discussion of forward-pass costs, variable-length attention, and padding, scoped to dense embedding models on H100-class GPUs.
- Context RotArticle
Chroma's experiments on how input length, semantic ambiguity, and distractors affect model performance.
Architecture and evaluations for Gemma 3, including a dated preliminary Chatbot Arena comparison with larger models.
- Qwen2 attention implementation in vLLMRepository
A version-pinned implementation showing combined QKV projections in Qwen2 attention.
The original Transformer architecture, including its sinusoidal positional encoding formulation.
A historical account of public model repositories, derivative models, and adoption across Hugging Face.
Read the transcript and explore slides
Loading transcript and slides…