Making vLLM less painful to set up

fllame: a CLI application to set up vLLM using Docker
Source code (MIT): https://github.com/Profit4Cloud/fllame
Why fllame?
vLLM is an awesome solution to run local LLMs. It is super easy to set up if you exactly follow a tutorial created for a model you don’t want, for a machine you don’t own. In other words, it is not easy at all. First, you will struggle to find out which models are most suitable for your hardware, since Hugging Face lists thousands of models. Then you will try a model, which crashes during initialization, possibly due to an OOM that takes your whole system down with it. Eventually, you find settings that actually work, and the model is up and running. However, when you use it, you trigger a runtime bug, because you used the latest vLLM image instead of the image the example you found was created for.
That is why fllame was created: to make setting up vLLM less painful.
Principles of fllame
- Docker first. vLLM always runs in a Docker container, and all parameters, environment variables, etc. end up in a compose.yaml and, if you need pre-install commands, in a Dockerfile. You can copy these files to a similar system and run them there without installing fllame.
- Hand edits are respected. You are free to edit the generated files. fllame will still use them for serving, benchmarking, etc. without overwriting them, unless you specifically run fllame recipe build.
- Network during setup, not at runtime. The network is used to pull models and images during setup, but not when the model is running. vLLM does not follow this principle by default. fllame sets the configuration needed to achieve this (see README). However, since you have full control over the configuration, you should test it by switching off the internet and checking that the model keeps working.
Prerequisites
To run fllame, you need:
- Python 3.12+
- Docker + Compose
- An NVIDIA GPU + NVIDIA Container Toolkit
Installation
git clone https://github.com/Profit4Cloud/fllame.git
cd fllame
pipx install .
Pipx is not necessary, but handy. By default, it installs fllame in ~/.local/share/pipx/venvs/fllame. After that, fllame can be run from anywhere on the system, and the cloned repo can be removed.
You can also use pip install in a virtual environment, if you prefer no extra dependencies.
Hardware scan
Scan the hardware of your machine to get an overview of the GPU, the RAM, and the supported quantizations:
fllame hardware scan

This is not only so you know what your own system can do, which you probably already know; fllame also uses it to assess whether a model can run on your system.
Model management
Scan Hugging Face for models:
fllame model scan -q QUERY [--quant QUANTIZATION]

Only models that will actually run on your machine will be listed, given the VRAM amount and supported quantizations. The models are ranked by popularity (number of downloads) and by how close to your max VRAM they are (bigger is better in this case).
For more options to limit the search by model size, see the help with -h.
Pull the model with:
fllame model pull REPO_ID

The model will be downloaded into the Hugging Face cache folder. In my case, the logging is quite short, since I had already pulled the model before.
View the downloaded models:
fllame model list

This lists all models in the Hugging Face cache folder, including models not pulled by fllame but in other ways, such as with hf download.
The philosophy of fllame is to use the internet during setup, but not after that. While the model is running, it should not have network dependencies. That means that vLLM is prevented from checking if the model is up to date. You must do that yourself:
fllame model update
This command only checks the status without pulling anything. If you want to check and also pull the new model versions, use:
fllame model update --apply

In my case, all models are already up to date, so nothing is pulled. You can also update a specific model from the list:
fllame model update REPO_ID --apply
Recipe management
Recipes are vLLM serve commands with their parameters, combined with other needed settings, such as pre-install commands, environment variables, or a specific Docker image.
You can search recipes for your model on the vLLM website:
https://recipes.vllm.ai/
To add a recipe, run the command:
fllame recipe add
In a short dialogue, you enter the Docker image (if not the default), pre-install commands, environment variables, and the vllm serve command including parameters.

You can also use the vllm serve command as a parameter:
fllame recipe add <vllm serve command>
This will create a recipe without a dialogue using the default image. This can only be used if you have no environment variables or pre-install commands.
List all your recipes:
fllame recipe list

The recipe I just added uses Qwen3.8-27B, for which another recipe already existed, so it is suffixed with _2.
How much VRAM the recipe will actually use depends on many factors, such as quantization, KV cache data type, max model length, and number of concurrent requests. Also, there is a lot of model-specific magic, so figuring it out exactly would require rebuilding vLLM from scratch, which I found too much of a hassle. However, you can get a reasonable estimate like this:
fllame recipe vram RECIPE_ID [--details]

Now we have a bunch of fllame-specific configuration that no other application can use. By building the recipe, this can be converted into a compose.yaml and, if pre-install commands were used, a Dockerfile.
fllame recipe build RECIPE_ID
If a Dockerfile is created, it will also be built.

Recipe storage location: ~/.config/fllame/recipes

You are free to edit these files. In fact, consider fllame a tool to generate these files. The whole point is to create a working compose.yaml that is easily portable. fllame will never rebuild these files automatically, unless you give the specific recipe build command. An exception is when you change defaults on which the files depend. In that case, you are asked to overwrite, but only a text replace is done; nothing else is changed.
When you copy compose.yaml to another system, make sure to download the model to the Hugging Face cache first (hf download), because the file contains HF_HUB_OFFLINE=1 to prevent vLLM from accessing the internet to download or update models. If the recipe also uses a Dockerfile, make sure to build it first: docker build -t <name used in compose.yaml> .
Serving the model
Finally, we get to actually serve a model:
fllame serve RECIPE_ID

This involves a lot of waiting. You can use the printed docker logs command to see what is going on. If you just want to know when it is ready, you can check the status:
fllame status [RECIPE_ID] [--watch]

The --watch flag makes it wait until ready. Add the recipe ID if you only want to see the status of one model.
Of course you don’t trust the status saying it’s ready. You want to know for sure:
curl -s http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "<REPO_ID>",
"temperature": 0,
"prompt": "What is the capital of France? Answer with only the name.",
"max_tokens": 5
}' | jq -r '.choices[0].text'

Benchmark a model
You can benchmark a model using:
fllame bench RECIPE_ID
The benchmark will be done serially first, and then with 4, 8, 16, and 32 concurrent requests, with a 10K-token input and 1K-token output. To change the benchmark settings, check out fllame bench -h.

The results of the benchmark are stored in the recipe folder, including all settings and files used. This makes a benchmark fully reproducible. That means you can experiment by altering a recipe or its compose.yaml or Dockerfile and running the benchmark again to see any changes, without forgetting whatever settings were used in the past.
Stop a running model
You can stop a running model with:
fllame stop [RECIPE_ID]
This will look up the recipe folder containing the compose.yaml and run docker compose stop for it. Without a recipe ID, all running models will be stopped.
You can also stop the container with Docker. Each fllame container has a name in the format fllame-RECIPE_ID.

Configuration
To look up the configuration settings:
fllame config show

To change the default vLLM Docker image, run:
fllame config set-default-image TAG
To look up the latest stable vLLM image, go to:
https://hub.docker.com/r/vllm/vllm-openai/tags
Search for short tags, with a format like v0.30.0. It is advisable to use a specific tag and not latest. This prevents automatic upgrading of vLLM images, which might break a currently working model.
If you change the default image, the new image is pulled first. You are then asked if the old default should be replaced in existing recipes. If you agree, a text replace is done, leaving any manual edits intact. After that, the images of affected recipes with a Dockerfile are rebuilt.

You can change the default GPU utilization with:
fllame config set-default-gpu-memory-utilization FLOAT
Make sure to use a number between 0.0 and 1.0. It is better not to set it to 1.0, leaving some room for other processes to access the GPU. Especially on a unified system, such as the DGX Spark, setting it to one will freeze the system, and you will need to do a hard reset. Lower it when you want to use the GPU for other stuff, such as playing Bannerlord.
Uninstall fllame
Uninstall fllame with:
pipx uninstall fllame
Not tested, of course, since I am using fllame myself.
I work at Profit4Cloud as an AI Engineer. If you want to hire one or work with AI before it takes your job, visit www.profit4cloud.nl.