Gardens of AI

· 23 min read

From Hugging Face to the GPU: learning how AI inference works

vllmhugging faceinferencegpuqwenquantizationawqself-hostingamazon ec2

I use Amazon Bedrock for a lot of my AI work. It makes it straightforward to work with frontier models without managing the infrastructure that serves them. For this experiment, I wanted to follow the path from the files on Hugging Face to an answer produced on a GPU.

Over the course of a week, I ran an open-weight model on Amazon EC2 with vLLM. I started with text generation, connected OpenCode for an open source agentic harness, added image input, and split the model across three nodes. Along the way, the startup failures were as useful as the successful requests. They showed where the model files ended and the work of the serving software and hardware began.

This post follows that process, including the commands, the memory problems, and what they helped me understand about inference. It was a learning experiment rather than a production deployment, but running the stack directly made the responsibilities of each part much clearer.

Starting with the files on Hugging Face

My first stop was Hugging Face. The model card gave me the publisher's description and usage guidance, while the configuration and file list showed what I would actually be running.

I chose QuantTrio/Qwen3.5-9B-AWQ, a community-quantized version of Qwen3.5-9B. Qwen developed the original model; QuantTrio published this conversion. The original model and the lower-precision conversion are related, but their files are different, so I read the documentation with that in mind.

Raw weight size for nine billion weights: 36 GB at 32 bits, 18 GB at 16 bits, and 4.5 GB at four bits. Fewer bits per weight means less memory, but some precision is lost.
Raw weight size for nine billion weights: 36 GB at 32 bits, 18 GB at 16 bits, and 4.5 GB at four bits. Fewer bits per weight means less memory, but some precision is lost.

A checkpoint holds the model's trained weights, the numerical parameters learned during training. In this repository, those weights came with the supporting files needed to load the model and prepare its inputs:

The Hugging Face file list for the pinned model revision. It shows configuration files, five weight shards, and tokenizer files.
The real Hugging Face file list, captured on 23 October 2026 at the revision used in this experiment. The five large .safetensors files hold the weights. config.json describes the architecture and settings. The tokenizer files describe how text is encoded.
  • Weights: split across five .safetensors files, with an index that maps each weight tensor to its file.
  • Configuration: the architecture, layer counts, and quantization settings.
  • Tokenizer: the vocabulary and rules used to turn text into token IDs, and back into text.
  • Chat template: the format used to present messages, instructions, and tool definitions to the model.
  • Image-processing settings: how to prepare input for the vision component.

The five weight files are shards: the weights are cut into five smaller files for storage and download. They are not five stages of the model. Later in the experiment, I split the computation across GPUs by groups of layers, and that split does not follow the file boundaries. Splitting files for storage is separate from splitting computation.

Of these files, the tokenizer is the easiest to inspect by hand. It offered one small amusement: a few familiar swear words split into oddly well-behaved token IDs. Even profanity has to be introduced to the model one piece at a time. The table below comes from the repository's tokenizer.json. In the token column, Ġ marks a leading space.

TextTokensToken IDs
damndamn85568
bullshitbull + shit40617, 38722
assholeass + hole389, 29430
bloody hellblo + ody + Ġhell36883, 1041, 14351

The model never sees the words, only the IDs. A single word can be one token or several.

With the contents of the repository clear, I downloaded the checkpoint with the Hugging Face command-line tool and pinned a revision for the serving tests. To repeat the download with that same revision, the commands are:

hf download QuantTrio/Qwen3.5-9B-AWQ \
  --revision 938f8e3ef86c9d1e9bec3705e149694c172592f1 \
  --dry-run

hf download QuantTrio/Qwen3.5-9B-AWQ \
  --revision 938f8e3ef86c9d1e9bec3705e149694c172592f1

With the command-line tool already installed, the dry run lists what would be downloaded. The Hugging Face repository page also lists the files and their sizes, so I could have checked the total without downloading them. Pinning the revision keeps later tests tied to the same checkpoint, even if the publisher updates the repository.

That gave me the files. Before loading them, though, I wanted to understand their size. The model was described as nine billion parameters with four-bit quantization, yet the download was about 12.4 GB.

A closer look at four-bit

Quantization stores selected weights with fewer bits. This reduces their memory and storage requirements, but it also changes how precisely their values can be represented.

This checkpoint uses AWQ, short for Activation-aware Weight Quantization. AWQ is a method for choosing how to convert weights to four bits so that the model loses less accuracy. The section after the table explains how it works.

For a model with exactly nine billion values, the simple calculation looks like this:

FormatBits per valueRaw size
FP32¹3236 GB
FP16¹1618 GB
Four-bit²44.5 GB

¹ FP32 means 32-bit floating point. FP16 means 16-bit floating point.

² The four-bit row is a raw-size estimate, not the checkpoint's actual size on Hugging Face. The checkpoint config specifies AWQ with bits: 4, but it excludes some components from quantization. The 4.5 GB estimate assumes all nine billion values use four bits; it leaves out scale values and other metadata.

These are decimal GB estimates for the weight values alone. They leave out metadata, other model components, and the working memory needed during inference. Quantization changes how each weight is stored, not how many weights a layer has. For example, a 2 × 3 weight matrix still represents six weights after quantization, although its stored representation changes.

Four bits give each weight one of 16 possible codes, from 0000 to 1111. In this AWQ format, a small group of weights shares two numbers: a scale and a zero-point. Together they turn each code into a value: (code − zero-point) × scale. To store a weight, the quantizer picks the code whose value is nearest to it. Two different weights in the same group can therefore get the same code, and both are read back as the same value. This is why quantization is lossy, and why it can change the model's answers.

One group of four-bit codes, 0000 to 1111, with the value each code stands for. The weights minus 0.73 and minus 0.68 both round to code 0001, so both are read back as minus 0.70. The small difference between them is lost.
One group of four-bit codes, 0000 to 1111, with the value each code stands for. The weights minus 0.73 and minus 0.68 both round to code 0001, so both are read back as minus 0.70. The small difference between them is lost.

What makes AWQ activation-aware?

The idea of AWQ is to reduce the effect of that lost precision by looking at how the weights are used.

A layer multiplies its input values by weights and combines the results. Those inputs are activations: intermediate numerical values produced as the model processes a request. If an activation is large, a small rounding error in the corresponding weight can have a larger effect on the result.

The same illustrative weight change produces a product change of 0.03 with an activation of 1, and 0.30 with an activation of 10. A larger activation increases the effect of the same weight rounding error in this multiplication.
The same illustrative weight change produces a product change of 0.03 with an activation of 1, and 0.30 with an activation of 10. A larger activation increases the effect of the same weight rounding error in this multiplication.

AWQ is not part of training, and it is not an AI model that changes another model. It is a conversion step that runs once, after training. The finished full-precision model goes in, and a smaller set of weight files comes out.

The original AWQ method does the conversion in three steps:

  1. Measure. Run a small set of sample inputs through the model and record how large the activations are. This is called calibration.
  2. Protect. Use the measurements to find the inputs where a rounding error would matter most. Scale up the weights that read those inputs, and scale down the matching activations by the same factor. The result of the calculation does not change, but a larger weight loses a smaller share of its value to rounding.
  3. Convert. Round all the weights to four bits.

No new weights are learned. The original method does not use backpropagation, the training step that adjusts weights. It only uses the measurements to choose how to convert the existing weights.

Only the weights shrink. The activations stay at 16-bit precision, which is often written W4A16 (four-bit weights, 16-bit activations). The memory for activations and the request cache is a separate cost.

This checkpoint's model card describes its conversion as “data-free”. Usually this means the conversion did not use a separate set of example inputs for calibration, so it differs from step 1 of the original method. It does not mean the original model was trained without data. The publisher did not explain the steps it used, so I could not check how it chose its scaling factors.

Why the download was larger than the simple calculation

The next clue was in config.json. Alongside the four-bit setting, it listed components that were not converted, including the vision and attention components:

The real Hugging Face config.json excerpt. It declares quant_method awq, bits 4, group_size 128, and zero_point true. The modules_to_not_convert list contains visual, linear_attn, self_attn, model.layers.0., and mtp.
A crop of the real config.json at the pinned revision, captured on 23 October 2026. Line 107 declares four-bit weights. Lines 111–117 list the exclusions.

Reading these fields together explained the mixture of formats:

  • bits: 4 applies to the weights selected for quantization, rather than every tensor in the model.
  • group_size: 128 means the quantized weights are split into groups of 128. Each group has its own scale and zero-point, explained below.
  • modules_to_not_convert lists the exclusions. visual identifies the vision component; linear_attn and self_attn identify attention components. The list also includes the first-layer prefix, model.layers.0., and mtp.

The group_size setting is easier to see with an example. Quantization needs a scale, the spacing between the 16 possible values, and a zero-point, the code that stands for zero. One scale for a whole layer would have to cover its largest weights, so its small weights would lose precision. Instead, the weights are cut into groups of 128, and each group gets its own pair.

Nothing chooses which weights go together. Position decides. Each layer's weights form a table, and the quantizer reads every row from left to right in blocks of 128 neighbouring weights. Each block is one group. The scale and zero-point of a group are then calculated from the smallest and largest weight inside it. A group of small weights ends up with a small scale, and a group of larger weights ends up with a larger one.

Two groups of weights on one number line. Group A has a scale of 0.02, so its 16 codes sit close together and the largest rounding error is 0.01. Group B has a scale of 0.1, so its codes are spread wider and the largest rounding error is 0.05. Each group stores its own scale and zero-point.
Two groups of weights on one number line. Group A has a scale of 0.02, so its 16 codes sit close together and the largest rounding error is 0.01. Group B has a scale of 0.1, so its codes are spread wider and the largest rounding error is 0.05. Each group stores its own scale and zero-point.

The groups cost little. The 128 four-bit codes in a group use 64 bytes. The shared scale and zero-point need extra storage, but only one pair for every 128 weights, not one pair for every weight.

The components in the modules_to_not_convert list were not disabled. They could still run at higher precision and their weights still needed memory. That distinction became useful later, when I deliberately skipped the vision component to get the model running on one GPU.

The download size was starting to make more sense: compact weights, higher-precision components, scales, and other metadata all contributed. “9B, four-bit” was useful shorthand, but not enough to work out the full memory requirement.

With that understood, I could move from inspecting the files to running them.

Putting the files to work with vLLM

To run the model, I used vLLM, an open source inference server. It loads the model and answers requests over an HTTP API. It also decides which requests run when, keeps the caches, and runs the model on the GPU. I ran it in Docker so that its software dependencies came packaged with it.

The work was split three ways. The container held vLLM, PyTorch, and the GPU libraries. The EC2 host provided the operating system, the NVIDIA driver, and the GPU. The model files stayed outside the container, in the Hugging Face cache on the host, and I mounted that cache into the container.

That split taught me something I kept coming back to: the weights hold what the model learned, but software decides what to do with them.

Hugging Face supplies model files. vLLM selects supported model code, loads the weights and schedules requests. Frameworks and GPU libraries dispatch the operations that the GPU executes.
The files, model implementation, and execution system have different jobs. A weights file is not a complete running service.

vLLM does not run a model from the weights alone. It reads the architecture name in config.json and looks for code that implements that architecture: the model's layers, operations, and connections. The vLLM documentation lists the architectures it supports, and a model is "supported" when vLLM can find that code. It has two ways to find it:

  • Native implementation: vLLM has its own code for the architecture.
  • Transformers modeling backend: vLLM uses the model code from the Hugging Face Transformers library instead.
The Supported Models page in the vLLM documentation. It says vLLM lists the model architectures that have been implemented in vLLM. Under Model Implementation, it describes native vLLM implementations and the Transformers modeling backend.
A screenshot of the Supported Models page in the vLLM documentation, captured on 27 November 2026. "Supported" means vLLM has code for the model's architecture, either its own or through Transformers.

The configuration only helps pick and set up that code. It is not a full description of how to run the model. Support for an architecture also does not say which GPU, memory size, or settings the model needs. This is why the vLLM tag on a Hugging Face page was only a starting point for me. I still needed matching model code, a quantization format that vLLM supports, a runtime, and a GPU that could run it.

Getting the model to fit on a Tesla T4

I wanted a cost-effective way to test, so I chose a small GPU on purpose: a Tesla T4 on EC2, which reported 15,360 MiB of GPU memory. Trying to fit a larger model onto a smaller GPU is a good way to learn how inference uses memory. It also made it cheap to experiment later with several instances running one model. It made the difference between file size and runtime memory very practical.

Once vLLM could start, it got far enough to load the model:

Model loading took 11.14 GiB memory

That looked like progress, but the server was not ready yet. Preparing the GPU kernels ran into an out-of-memory error. A kernel is a small program that runs on the GPU, for example one that multiplies large tables of numbers. vLLM prepares these before it serves requests, and that preparation needs memory. A later startup also failed because there was too little memory left for the request cache.

The weights were only part of the allocation. The runtime also needed temporary working memory, space for the prepared kernels, and stored state for requests. The main example is the KV cache. As the model reads a prompt, it keeps numbers called keys and values for each earlier token, so that it does not have to work them out again for every new token. That store grows with every request and every token.

I increased vLLM's GPU memory budget from 90% to 95%, but that alone was not enough. The useful change was to start with text only:

--language-model-only

Skipping the vision component reduced the logged model-loading memory from 11.14 GiB to 10.28 GiB. Those figures describe loading memory rather than peak use, but the reduction gave the rest of the runtime more room.

With a short 1,024-token context (--max-model-len) and one scheduled sequence (--max-num-seqs), the server started successfully. I now had a working baseline that I could extend.

Here is the successful single-T4 launch command from my notes. It assumes Docker, NVIDIA GPU support, and the model cache are already prepared on the EC2 host:

sudo docker run -d \
  --name qwen \
  --gpus all \
  --network bridge \
  --ipc=host \
  -p 127.0.0.1:8000:8000 \
  -v /home/ubuntu/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:v0.32.0-ubuntu2404 \
  QuantTrio/Qwen3.5-9B-AWQ \
  --revision 938f8e3ef86c9d1e9bec3705e149694c172592f1 \
  --dtype half \
  --max-model-len 1024 \
  --max-num-seqs 1 \
  --gpu-memory-utilization 0.95 \
  --enforce-eager \
  --language-model-only

The cache mount makes the downloaded files available inside the container, while the port mapping keeps the API on the host's loopback address. --dtype half selects FP16 for non-quantized floating-point computation without expanding the packed four-bit weights into a full FP16 checkpoint. --enforce-eager disables CUDA graph capture.

From the host, I could then inspect the startup logs and check readiness:

sudo docker logs --tail 100 qwen
curl -i --max-time 10 http://127.0.0.1:8000/health

The health check returned HTTP 200 once initialization had finished. The difference between “weights loaded” and “ready to answer” was now clear from the startup process, rather than just from a description of GPU memory.

What the GPU was running

With the model running, I could see what the GPU was actually doing. This was the idea that made inference make sense to me. The model itself is only weights: a large collection of learned numbers, grouped into layers. It does nothing on its own. The software around it, here vLLM, does the work. It turns the prompt into numbers and passes them to the first layer. It takes what comes out and passes that to the next layer, and so on, until the last layer produces scores for the next token.

In code, this can look as simple as this:

def forward(self, x):
    for layer in self.layers:
        x = layer(x)
    return x

This is an illustration rather than the exact Qwen code. A real model also has attention, normalization, and other operations inside its layers. The useful point is that the code decides the order and moves the numbers from layer to layer, while each layer supplies its own weights.

The numbers passed from one layer to the next are the intermediate outputs, called activations, which we met in the AWQ explanation. Each layer applies its weights to the activations it receives and produces new activations. During ordinary inference, the weights never change. Only the activations change as the request is processed.

Input values pass through layers that each use their own stored weights. The model produces scores for the next token. The serving system selects a token and repeats with cached state.
Activations change as a request is processed. During ordinary inference, the trained weights remain fixed.

PyTorch and GPU libraries turn those model operations into work for the hardware. A GPU kernel is a function that runs on the GPU, with lower-level implementations for tasks such as matrix multiplication, attention, and normalization.

Python can direct the sequence of operations without performing every multiplication itself. Libraries dispatch or compile the kernels, and the GPU carries out the numerical work in parallel. Optimizations can combine operations or replay recorded GPU work, so execution need not follow the simple loop exactly.

That gave me a clearer way to think about the stack. The model implementation defines the calculation, training supplies the learned parameters, and the runtime determines how that calculation executes on the hardware.

The next step was to follow that calculation through a complete request.

From a prompt to the next token

For a text request, the server first applies the chat template and tokenizer. The formatted messages become token IDs, and the model maps those IDs to numerical representations called embeddings. A token can be a word, part of a word, punctuation, or another symbol.

Processing the initial prompt is called prefill. The model works through that input and builds the attention or other state that it will reuse during generation.

Then comes decoding. The model produces scores for possible next tokens, and the generation settings determine how one is selected. The selected token is added to the sequence. Generation then repeats until an end token, output limit, or another stop condition is reached.

A text request in two stages. Prefill turns the messages into token IDs and embeddings, then runs them through the layers once to build the cache. Decoding repeats: the layers reuse the cache and give scores, one token is picked and added to the sequence, until a stop condition.
A text request in two stages. Prefill turns the messages into token IDs and embeddings, then runs them through the layers once to build the cache. Decoding repeats: the layers reuse the cache and give scores, one token is picked and added to the sequence, until a stop condition.

The stored state is what makes the cache important. The system can reuse earlier work instead of recalculating the whole sequence from the beginning for every new token.

This also helped explain the --max-model-len 1024 setting in the launch command. It sets the context length, the number of tokens the model can hold at once. It is a budget for input and generated output together, not just for the visible question. In a coding session, the input can include instructions, tool definitions, conversation history, and file contents.

Calling the model and connecting OpenCode

Once the health check passed, I could send a request directly from the EC2 host. This example uses the prompt and settings from the first successful generation in my notes:

curl -sS --max-time 180 \
  http://127.0.0.1:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "QuantTrio/Qwen3.5-9B-AWQ",
    "messages": [{
      "role": "user",
      "content": "Explain what a GPU does in two short sentences."
    }],
    "max_tokens": 128,
    "temperature": 0,
    "chat_template_kwargs": {"enable_thinking": false}
  }' | python3 -m json.tool

Unlike the health check, this runs inference and returns generated text along with token counts. It was a useful way to test the model before adding another application.

I then connected OpenCode, an open-source coding application. A coding application needs the model to use tools, such as reading a file or running a command. This adds a step beyond generating text, and it needed two extra vLLM options at startup: --enable-auto-tool-choice and --tool-call-parser.

A model cannot run a tool. It can only write text that asks for one, in a format that depends on the model family. The tool-call parser is part of vLLM. It reads that text and turns it into the structured tool-call data that the API returns to OpenCode. You choose the parser that matches the model's format. OpenCode then applies its permissions and runs the tool.

To measure speed, I used a small Python benchmark. It sent one warm-up request followed by five measured requests, each producing 61 output tokens. The mean total request time was about 3.18 seconds. Dividing the output tokens by that time gave about 19.18 tokens per second. This measured the complete request, not decoding alone or time to the first token. The short, repeated inputs also meant cache reuse could affect the results.

Having established that baseline on one T4, I moved on to distributed inference.

Splitting the model across machines

I split the model across two machines first, and later across three. The two-node setup used two g4dn.2xlarge instances, each with one T4. I used pipeline parallelism to divide the model into groups of layers, with each stage passing intermediate tensors to the next over the private network.

Network placement matters for this design, because the stages send data to each other for every token. I put the instances in the same subnet, and so in the same Availability Zone, to keep the network path short and the latency low. Traffic between instances in one Availability Zone also avoids inter-zone data transfer charges.

Placement does not change how much bandwidth an instance gets. On EC2, the available bandwidth depends on the instance type and its number of vCPUs. Smaller sizes are listed as "up to" a figure. They have a lower baseline and can burst above it for a limited time, using network credits. A single connection between two instances is also capped, typically at 5 Gbps, unless the instances are in a cluster placement group. For each new token, the data passed between stages is small, so in a test like this the delay on each hop matters more than raw bandwidth. For larger models split across many GPUs, the network becomes a real part of the design.

This extended the same execution path described earlier. Activations moved between layer groups, but now those groups ran on different machines. It was one model distributed across stages, rather than a load balancer selecting between independent copies.

The recorded two-node launch used these options:

--tensor-parallel-size 1
--pipeline-parallel-size 2
--distributed-executor-backend mp
--nnodes 2

Each option does one job:

  • --pipeline-parallel-size 2 cuts the model into two stages, one for each GPU.
  • --tensor-parallel-size 1 means no layer is split inside a stage. Each layer stays whole on one GPU.
  • --nnodes 2 tells vLLM that the work runs on two machines.
  • --distributed-executor-backend mp uses vLLM's own multiprocessing to start the worker processes. The other common choice is Ray, which I did not use.

These options are not a complete launch command. The two machines also had to find each other. Each node needed its own number in the group (its rank) and its own local address. Both nodes also needed the same address for the head node, the machine that coordinates the group. The second node, the worker, also used --headless, which means it runs the model but does not serve the HTTP API. These settings describe the two-node test. I have not included a full command for the later three-node run.

The three-node version of the same idea looks like this:

A three-node pipeline split. Intermediate tensors pass from the first group of layers to the middle group and then the final group.
A three-node pipeline schematic. It shows the layer split, not exact hardware, layer assignments, or GPU memory use.

Distributing the layers gives each GPU a smaller part of the model to hold, but it does not create one shared memory allocation. Each stage's weights and working state must still fit on its local GPU.

Once the workers were running, I wanted to see how much GPU memory each stage used. nvidia-smi is NVIDIA's tool for this. It reports each GPU's memory use, its utilization (how busy it is), and the processes using it. I ran it on the host with watch, which repeats the command every two seconds:

watch -n 2 nvidia-smi

This is the output for one worker node:

NVIDIA-SMI shows a Tesla T4 with 14,415 MiB of GPU memory in use. The VLLM::Worker_PP2 process uses 14,412 MiB. Reported GPU utilization is 0%.
The Worker_PP2 process on a T4, in a screenshot dated 23 October 2026. The device reports 14,415 MiB used out of 15,360 MiB. GPU utilization is 0% at this sample.

In this sample, the T4 held almost all its available memory while reported GPU utilization was 0%. A loaded model can keep memory allocated between requests; allocated memory and active computation are different readings.

This screenshot shows one worker, not peak memory or performance for the cluster.

To compare the one- and two-node setups, I repeated the same short benchmark:

Recorded resultOne T4Two T4s
Mean total request time3.18 s2.51 s
Output tokens / total request time19.18/s24.30/s
Successful measured requests5 of 55 of 5

The second GPU gave a speed-up of about 1.27×, not 2×. These were short tests, not a controlled scaling study, so I cannot attribute the whole difference to pipeline parallelism. The table has no three-node results.

The extra memory also let me return to the component I had skipped to get the first server running: vision.

Bringing the vision component back

For the two-node vision test, I enabled the vision component again and configured a 32,768-token context limit. That was a configured limit rather than a tested long request; I did not test a request near it.

With the vision component enabled, the model returned a three-sentence description of a bench and wall. This was a successful image request, not a formal evaluation of visual accuracy.

A wooden bench built into an old stone wall beside a paved path.
A bench against a wall. Photo: "Bench and wall" by Jonathan Thacker, CC BY-SA 2.0, via Wikimedia Commons.

What mattered to me was how the image reached the model. The model never sees a picture. Software outside the model does the first step: it decodes the image file and turns it into numbers, with operations such as resizing, rescaling, and normalization, and arranges the pixel values into tensors. The vision component, which is more layers with their own learned weights, then turns those tensors into features. The model code connects these features to the language layers, which treat them like the numbers that come from text. From there, the model generates a text answer one token at a time, exactly as before.

This is the same pattern as tool use. The model does not run a tool, and it does not open an image. It only works on numbers, and the software around it does the rest. Image input added a preparation step and more learned weights. Software still defined the operations, the weights supplied learned values, and the GPU did the numerical work.

Software turns a text prompt into token IDs and an image file into numbers. These go into the model, which is layers of learned weights. Software then picks a token for the text answer, and reads any tool request in the text and runs the tool. The model itself only works on numbers.
Software turns a text prompt into token IDs and an image file into numbers. These go into the model, which is layers of learned weights. Software then picks a token for the text answer, and reads any tool request in the text and runs the tool. The model itself only works on numbers.

Final thoughts

I started this experiment wanting a closer view of what happens beneath a managed inference API. By the end, I could follow the path from downloaded files through model code and GPU execution, across machines and to image input.

The responsibilities were much easier to connect:

  • Hugging Face supplied the weights and the supporting files. Quantization made those weights smaller, at the cost of some precision.
  • The tokenizer and input-processing software turned text and images into numbers.
  • The model code and the trained weights defined the layers. The model itself is only numbers.
  • vLLM managed requests, caches, and the movement of numbers from layer to layer.
  • Frameworks, GPU libraries, and hardware carried out the numerical work.

The memory problems helped connect these responsibilities too. A nine-billion-weight model in four bits is a small file, but it is not the full memory cost. The out-of-memory errors came after the weights had loaded, because the runtime also needed working memory and a cache for each request. A small GPU made that easy to see.

For me, the useful outcome was being able to connect the parts I already worked with through Amazon Bedrock to the systems underneath them. A model name became a specific set of files, some software that moves numbers through them, and a workload with real memory and execution requirements. The idea that stayed with me is that a model is just weights, and the code around it does the rest.

Understanding that process does not make what these models can do any less interesting. It gives me a clearer basis for understanding their behaviour and the choices involved in serving them.

References

The recorded serving image was vllm/vllm-openai:v0.32.0-ubuntu2404. The recorded model revision was 938f8e3ef86c9d1e9bec3705e149694c172592f1.

Useful references:

The stable documentation can change. The image and model revision above identify the software and files used for these recorded tests.

Comments and feedback

Comments use GitHub Discussions. You need a GitHub account to post.

← All posts