Close Menu
ToolTechBlogToolTechBlog

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    November 23, 2026

    How Notable Capital, GIC, and Baillie Gifford bet big on Anthropic before its IPO

    November 23, 2026

    Can you safely use a 140w charger on an iPhone?

    November 22, 2026
    Facebook X (Twitter) Instagram
    ToolTechBlogToolTechBlog
    • Home
    • AI Tools
    • Web Hosting
    • Tech
    • Digital Marketing
    • Business Software
    • VPN & Cybersecurity
    ToolTechBlogToolTechBlog
    Home»Web Hosting»Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked
    Web Hosting

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    Tool Tech TeamBy Tool Tech TeamNovember 23, 2026No Comments14 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email

    Community Article
    Community articles are authored by SitePoint Premium contributors. Content is screened before publication, and SitePoint reserves the right to moderate or remove articles that violate our guidelines. Views expressed are those of the authors and do not necessarily reflect those of SitePoint.

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    TATalha AnwarPublished inAI·
    November 17, 2026
    ·Updated:November 22, 2026

    The AI briefing for Developers

    Stay up to date with AI tools, model releases, and developer workflows that matter.

    Weekly. Free. One click to leave.

    SitePoint Premium
    Stay Relevant and Grow Your Career in Tech

    • Premium Results
    • Publish articles on SitePoint
    • Daily curated jobs
    • Learning Paths
    • Discounts to dev tools

    7 Day Free Trial. Cancel Anytime.

    When one person chats with a local model, it barely matters which server you run. On one RTX 3090 with the same model file, Ollama, LM Studio and llama.cpp wrote text within about 10 percent of each other, because all three run llama.cpp underneath. That changes when your app sends several requests at once. With four requests, the best setup produced more than three times as much text as the worst, and the cause was a default setting, not the engine. With 32 requests, vLLM produced 2.5 times as much text as the best llama.cpp setup I tested.

    This article puts those numbers side by side and shows which setting to change for your app.

    Key takeaways

    • One request at a time, the servers are close. All three llama.cpp-based servers generated a 9B model at 110 to 122 tokens per second. vLLM generated 115.
    • Ollama answers one request at a time by default. Four requests at once got the speed of one: 39.8 tokens per second in total with a 27B model, against 90.2 for LM Studio and 116.4 for llama.cpp with their default four slots.
    • Raising Ollama’s parallel setting can make it slower. With OLLAMA_NUM_PARALLEL=4, the 27B model no longer fit on the GPU, and total output fell to 33.1 tokens per second.
    • llama.cpp stops at four slots unless you set -np. With 32 requests at once, the last one waited 22.5 s for its first word. With -np 32, it waited 2.7 s.
    • vLLM is built for many users. At 32 requests it produced 1,730 tokens per second and started every answer within 0.6 s. It took 72 s to start and reserves 92% of the GPU by default.

    How the tests were run

    I ran every test on one machine. The full write-ups, with every command and the raw results, are on homebrewserver.club.

    PartWhat was used
    GPUNVIDIA RTX 3090, 24 GB
    CPU and RAMAMD Ryzen 9 5900X, 62 GB
    OSFedora 44, Docker 29.9.2
    ModelQwen3.5 9B and 27B, Q4_K_M GGUF files from unsloth (5.7 GB and 16.7 GB)
    ServersOllama 0.40.15, LM Studio’s headless llmster Docker preview, llama.cpp v1.0.0, vLLM 0.33.0

    Every server got the same requests:

    • Each request used either a short prompt of about 70 tokens or a long prompt of about 4,120 tokens.
    • Each prompt started with a random ID, so no server could reuse a cached prompt.
    • Thinking was turned off, and the temperature was 0.
    • Before each run, the script waited until the GPU had cooled to 50 °C. Without that pause, the same server lost up to a quarter of its speed in five runs, because the card throttled at 91 °C.
    • Single-request figures are the median of five runs. Figures with several requests are the median of three.

    Ollama, LM Studio and llama.cpp loaded the exact same GGUF files, checked by SHA-256. vLLM cannot run GGUF files well, so it loaded a 4-bit AWQ file of the same model (9.1 GB). Answer quality was not compared.

    The tests ran between 8 and 16 November 2026, and speeds on this machine varied by a few percent from one day to the next. Treat a gap under about 5% as a tie. All of this is one consumer GPU and one model family, so read the numbers as a guide to how the servers behave, not as a ranking for your hardware.

    One request at a time: the engine is the same

    Server9B, tokens/s
    llama.cpp v1.0.0121.6
    Ollama 0.40.15120.6
    vLLM 0.33.0115.3
    LM Studio109.7

    This is the short prompt with a 512-token answer.

    Ollama and LM Studio both start llama.cpp’s llama-server program for each model they load. Ollama has done this since version 0.30, and a comment in its with llama.cpp libraries and a llama-server binary

    Ollama logs the command it starts when you set OLLAMA_DEBUG=1. When llama.cpp was started by hand with that exact command, in a run next to Ollama, its speed matched Ollama’s within 1%. So Ollama adds no speed cost of its own. LM Studio was 5 to 10% slower in this test. The test did not separate whether that came from its llama.cpp build or its other start options.

    For one user, the gap between Ollama and LM Studio was about 0.4 s on a 512-token answer from the 9B model. You would notice it in long answers, and hardly in a chat window.

    Four requests at once: the default slot count decides

    A web app rarely sends one request at a time. A chat page, a background summary job and an agent can all call the same model at the same moment. The next test sent four requests at once, each asking for 256 tokens, and measured the total output per second.

    Setup9B, total tokens/s27B, total tokens/s
    Ollama, defaults (1 slot)114.539.8
    Ollama, OLLAMA_NUM_PARALLEL=4266.433.1
    LM Studio, 1 slot105.938.7
    LM Studio, defaults (4 slots)239.490.2
    llama.cpp v1.0.0, defaults (4 slots)332.1116.4
    vLLM 0.33.0397.6not tested

    A slot is one request that the server works on at the same time as others. llama-server sets the number of slots with -np (short for --parallel), and Ollama and LM Studio pass their own setting through to it.

    With one slot, the server answers the four requests one after another, so the total stays at the speed of a single request. That is Ollama’s default. With four slots, the server puts the four requests through the model together, and the total rose to more than twice that of one slot. That is the default in LM Studio and llama.cpp. vLLM was the fastest at four requests, but it was tested only with the 9B model. Its lead grows with more requests, as the section after next shows.

    For your app, this means that the fourth user of a default Ollama server waits for the first three answers to finish before their own answer starts.

    Why more slots made Ollama slower

    The obvious fix is OLLAMA_NUM_PARALLEL=4. It worked for the 9B model, though in one of three rounds Ollama still answered at the speed of a single request. With the 27B model, it made Ollama slower than its default.

    The cause is how each server sizes the context, the memory that holds each request’s prompt and answer. Ollama picks the context from the GPU’s memory: 32,768 tokens on a 24 GB card, according to its docs. With four slots, it gives each slot its own 32,768 tokens, so it started llama-server with a 131,072-token context. The Ollama FAQ says the memory needed grows with the number of parallel requests multiplied by the context length.

    That context did not fit next to the 27B model in 24 GB. ollama ps showed 16% of the model on the CPU, and the total speed fell to 33.1 tokens per second.

    LM Studio and llama.cpp handle it differently. Their four slots share one pool of context:

    • LM Studio loads a model with an 8,192-token context shared by four slots. The 27B model used 16,858 MiB of GPU memory and stayed on the GPU.
    • llama.cpp has a --fit option, on by default, that lowers the settings you did not set until the model fits. For the 27B model it chose a context of about 73,000 to 80,000 tokens, shared by four slots, and used about 21 GB.

    The price of LM Studio’s default is a short context. Four requests sharing 8,192 tokens leave little room for long documents or a long chat history. If your app sends long prompts, load the model with a larger context.

    In Ollama, setting a smaller context with OLLAMA_CONTEXT_LENGTH next to OLLAMA_NUM_PARALLEL should avoid the spill to the CPU. The test did not try this, so measure it on your own card.

    More than four requests: llama.cpp needs -np, vLLM scales further

    The last test went further, from 1 to 32 requests at once, with the 9B model. It compared vLLM, a server built to serve one model to many users, with llama.cpp at its defaults and with more slots. Ollama and LM Studio were tested only up to four requests, so they are not in this table.

    Requests at oncevLLMllama.cpp, defaults (4 slots)llama.cpp, -np 16llama.cpp, -np 32
    1113.9117.7117.3117.8
    4397.6332.1332.6330.3
    8771.1329.5498.0497.5
    161,282.5327.2635.6630.5
    321,730.0322.9617.3679.4

    All figures are total tokens per second.

    With its defaults, llama-server chose four slots by itself, so it worked on four requests and queued the rest. Its total stayed near 330 tokens per second from 4 requests to 32. Setting -np 16 or -np 32 roughly doubled the total at 16 requests.

    vLLM’s lead came from each request running faster inside a large batch. At 32 requests, each vLLM request generated about 61 tokens per second, against about 27 on llama.cpp with 32 slots. vLLM’s README names the two techniques behind this: PagedAttention, which stores each request’s working memory in small blocks, and continuous batching, which adds new requests to the batch the GPU is already working on.

    Total output tells you how much work the server does. The wait for the first word tells you how the app feels to the user behind the last request:

    Requests at oncevLLMllama.cpp, defaultsllama.cpp, -np 32
    80.2 s3.4 s0.6 s
    160.3 s9.7 s1.4 s
    320.6 s22.5 s2.7 s

    For a web app, that is 22.5 seconds of spinner before any text appears. Long prompts make every wait longer, on both servers. With eight requests of about 4,120 tokens each, the last request waited 7.9 s on vLLM and 8.8 s on llama.cpp with 32 slots.

    If you set the slots yourself, the llama-server README lists three options that work together:

    llama-server -m Qwen3.5-9B-Q4_K_M.gguf -np 32 -c 262144 --kv-unified
    • -np sets the number of slots. Pick a number close to the number of requests you expect at the same moment. With 16 slots and 32 requests, half of them waited, and the last one waited 7.8 s for its first word.
    • -c sets the context size. With a unified cache, it is one pool that all slots share.
    • --kv-unified makes the slots share that pool instead of splitting it evenly. It is on by default only when the server chooses the slot count, so add it when you set -np yourself.

    If you run an older llama.cpp, update first. Four requests at once ran 14 to 22% faster on v1.0.0 than on the build from five days earlier, while one request stayed the same. The most likely reason is a new CUDA kernel in v1.0 for steps of 2 to 24 tokens on RTX 30-series and newer cards.

    What vLLM costs: memory and start-up time

    vLLM’s throughput comes with two costs that matter on a shared machine.

    It reserves most of the GPU. By default, vLLM takes 92% of the card’s memory before it loads anything, and fills what the model does not need with cache. With a desktop and a browser holding about 2 GiB, vLLM refused to start:

    ValueError: Free memory on device cuda:0 (21.58/23.61 GiB) on startup is less thandesired GPU memory utilization (0.92, 21.72 GiB).

    Setting --gpu-memory-utilization 0.6 alone was not enough with this model, because the default limit of 256 sequences needed more cache than fit. Adding --max-num-seqs 32 fixed it. With both settings, vLLM held 12.7 GiB and kept the same speeds. llama.cpp works the other way: it sizes its cache from -c and -np and never asked for more than 15.1 GiB in this test.

    It starts slowly.llama-server answered requests 2 to 5 s after its container started. vLLM compiles the model before it serves anything. That took 72 s with its compile cache already on disk, and 173 s on the first start without it. Changing a vLLM argument triggered a fresh compile.

    It also needs a different model file. vLLM loads Hugging Face safetensors, so a 4-bit model is a separate AWQ or GPTQ upload. The AWQ file here was 9.1 GB against 5.7 GB for the GGUF, because its recipe leaves some layers unquantized. Check the file size, not only “4-bit”, when you size a model for your card.

    Pointing your app at any of them

    All four servers have an OpenAI-compatible API under /v1, so the same client code works with each one. You change the base URL and the model name. These are the ports used in the tests:

    ServerBase URL in the test
    Ollamahttp://127.0.0.1:11434/v1
    LM Studiohttp://127.0.0.1:1234/v1
    llama.cpp (Docker image)http://127.0.0.1:8080/v1
    vLLMhttp://127.0.0.1:8000/v1

    In Node.js with the openai package, that looks like the sketch below. The measurements came from a Python test client, and this snippet was not part of them:

    importOpenAIfrom"openai";const client =newOpenAI({baseURL:"http://127.0.0.1:8080/v1",apiKey: process.env.LOCAL_LLM_KEY??"none",});const res =await client.chat.completions.create({model:"qwen3.5-9b",messages:[{role:"user",content:"Summarize this ticket in two lines."}],});

    Qwen3.5 thinks before it answers unless you turn it off. The tests sent "chat_template_kwargs": {"enable_thinking": false} in the request body to vLLM and llama.cpp.

    None of the servers asked for a password in these tests. llama-server also warned at start-up that its CORS rule allowed all origins. Bind the port to 127.0.0.1, as in the table, and set --api-key on llama.cpp or vLLM if anything else on your network can reach it.

    Which server fits your app

    Your appServerSetting to change
    One user, or requests that rarely overlap, several modelsOllamaSet OLLAMA_CONTEXT_LENGTH if prompts are long. Test OLLAMA_NUM_PARALLEL with your model before relying on it.
    A few clients that overlap, a desktop with a graphical appLM StudioRaise the context with lms load … –context-length if four slots sharing 8,192 tokens is too little.
    Several overlapping requests, one model, fast restartsllama.cppSet -np near your expected peak, with -c and –kv-unified.
    Dozens of requests at once, or batch jobs and agents firing in parallelvLLMSet –gpu-memory-utilization and –max-num-seqs if anything else uses the GPU.

    Before you choose, count how many requests your app really sends at the same moment. Log the timestamps for a day, or count the parallel calls your agent makes per user action. If that number is one, any of these servers will do. If it is four or more, the slot setting will change your users’ wait more than the choice of engine.

    Frequently asked questions

    Is llama.cpp faster than Ollama?

    Not for one request with the same settings. Ollama runs llama.cpp’s own server, and the two were within 1% when started with the same command. llama.cpp was faster with four requests at once, because it starts four slots by default and Ollama starts one.

    Why does Ollama get slower when I set OLLAMA_NUM_PARALLEL?

    Ollama gives each parallel request its own full context. With four slots on a 24 GB card, that was 131,072 tokens, which pushed 16% of a 27B model onto the CPU. A smaller context may avoid that, but this test did not measure it.

    When is vLLM worth it over llama.cpp?

    When many requests arrive together. At 32 requests, vLLM produced 2.5 times the output of llama.cpp with 32 slots and kept every first-word wait under a second. For one request at a time, llama.cpp was 5% faster and started in seconds instead of more than a minute.

    Do I need to change my code to switch servers?

    Usually not. All four serve OpenAI-compatible endpoints under /v1, so you change the base URL and the model name.

    Local Ollama Serving several users
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Tool Tech Team
    • Website

    Related Posts

    How to Add AI Facial Expression Editing to Your Video Pipeline (2026)

    November 22, 2026

    5 Things Most Developers Get Wrong When Turning Images into HTML

    November 22, 2026

    What to Check Before Adding a Tripo Model to a Website

    November 21, 2026

    What Is BIO Tagging and How to Use It for Document AI Training Data

    November 21, 2026

    What to get right before you ship webhooks

    November 20, 2026

    From Script to Screen: A Developer’s Workflow for Long

    November 20, 2026
    Leave A Reply Cancel Reply

    Top posts
    Web Hosting

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    By Tool Tech Team
    AI Tools

    How Notable Capital, GIC, and Baillie Gifford bet big on Anthropic before its IPO

    By Tool Tech Team
    Tech

    Can you safely use a 140w charger on an iPhone?

    By Tool Tech Team
    Editors Picks

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    November 23, 2026

    How Notable Capital, GIC, and Baillie Gifford bet big on Anthropic before its IPO

    November 23, 2026

    Can you safely use a 140w charger on an iPhone?

    November 22, 2026

    ‘You Can See Everything’ has made more than $100M worldwide

    November 22, 2026
    About Us

    Welcome to ToolTechBlog, your trusted source for the latest insights, reviews, and practical guides on AI tools, business software, cybersecurity, web hosting, and consumer technology.
    Our mission is simple: to help individuals, entrepreneurs, freelancers, students, and businesses discover the right digital tools to improve productivity, streamline workflows, and make informed technology decisions.

    Our Picks

    Serving a Local LLM to Several Users: Ollama, LM Studio, llama.cpp and vLLM Benchmarked

    November 23, 2026

    How Notable Capital, GIC, and Baillie Gifford bet big on Anthropic before its IPO

    November 23, 2026

    Can you safely use a 140w charger on an iPhone?

    November 22, 2026
    Top Reviews

    The AI Hype Index: Unsexy AI

    July 29, 2026

    What it is and How to Fix it

    July 29, 2026

    LG to Ban Residential Proxies from Smart TV Apps

    July 29, 2026

    © 2026 tooltechblog.com. All rights reserved. Designed by DD.

    • About Us
    • Contact Us
    • Terms and Conditions
    • Privacy Policy
    • Disclaimer

    Type above and press Enter to search. Press Esc to cancel.