Run a local inference test
An inference service receives inputs and generates outputs. A local trial listens only on the local interface and uses test data.
Lessons in this path
How to do it
- Install a supported runtime using its documentation. On supported Linux and GPU environments, vLLM can expose an OpenAI-compatible API. On a different device, choose a documented runtime that supports the hardware.
- Start a local trial and send a simple test question. Once the model is loaded, check model selection, output format, response time and what happens with an input that exceeds the limit.
- Repeat your test at the expected request concurrency. If waiting time rises or results degrade, review your limits, context size and hardware before expanding the trial.
Apply the method · AI for enterprises
An enterprise is considering an internal inference service for several applications. The pilot uses a single workflow, synthetic data and separate user roles.
Define capacity limits, dependencies and runtime ownership. Test model upgrades and service downtime before adding an application.
Example for a test environment
This example assumes that vLLM and compatible hardware are already available. Run the second command in another terminal once the model has loaded. It lists the model from the local service.
vllm serve Qwen/Qwen3-4B-Instruct-2507 --host 127.0.0.1 --port 8000 --max-model-len 4096
curl http://127.0.0.1:8000/v1/modelsApply this in your organization
Define access and capacity per application. Verify isolation in staging before connecting business units.
Which runtime suits which environment?
A runtime (inference engine) loads the model and answers requests. The choice depends mainly on hardware and purpose. The table lists common categories with examples; check current documentation and hardware support yourself.
| Runtime (examples) | Typical environment | Strength | Limit |
|---|---|---|---|
| Ollama, LM Studio | Laptop, workstation, Mac | Quick start, easy to use | Limited with many concurrent requests |
| llama.cpp | CPU, Apple Silicon, basic GPUs | Runs almost anywhere, GGUF format | More manual work for operations |
| vLLM, SGLang | Linux server with GPU | High throughput with concurrent requests | Higher hardware and ops requirements |
| Text Generation Inference, NVIDIA Triton and others | Data centre, Kubernetes | Integration into existing platforms | Requires learning and platform skills |
A test protocol in five steps
The goal of a local test is a statement beyond “it runs”: how fast, how good and up to what load? Here is how to get there:
- Record hardware, driver version, runtime version, model ID, quantisation and context limit.
- Measure time to first token (how quickly the answer starts) and tokens per second (how fast it continues) for short and long inputs.
- Run your domain test set and score the answers as you would for any other model.
- Gradually increase concurrent requests, for example 1, 4, 8, 16, and note when waiting time becomes unacceptable for users.
- Test edge cases: input above the context limit, empty input, dropped connection, restart during a request.
Going deeper: throughput, latency and typical bottlenecks
Throughput (requests or tokens per second across all users) and latency (waiting time for an individual) are in tension. Server runtimes such as vLLM cleverly batch concurrent requests (continuous batching), which raises throughput but can increase latency for individuals. Decide what your use case needs: an employee chat needs fast first tokens, a nightly batch of documents needs throughput.
Typical bottlenecks are GPU memory (too little room for KV cache with long contexts), memory bandwidth (often determines tokens per second more than compute) and pre-processing of long inputs. A common testing error: measuring only with short inputs while real use processes long documents. Test with realistic lengths. During the trial, bind the service exclusively to 127.0.0.1 and disable telemetry or model downloads you have not reviewed.
Example: a start-up benchmarks a departmental service
A fictional start-up tests a model with around eight billion parameters using vLLM on a rented GPU. With a single request, the answer starts almost immediately. With 16 concurrent short questions, waiting time remains acceptable. With 16 concurrent requests each containing a ten-page document, time to first token rises markedly and some requests are rejected for lack of memory.
The team caps the maximum context length, adds a queue for long documents and records: chat questions up to 16 concurrent, document analyses up to 4. The domain test set shows two incorrectly copied numbers with the 4-bit variant and none with the 8-bit variant; the team picks 8-bit. All values are in the test log and are repeated after every runtime update.
Common mistakes
- Binding the service to all network interfaces during testing. An open port on the office network is easily forgotten.
- Measuring only speed. A fast but inaccurate model is not a success.
- Adopting benchmark results from other hardware. GPU, drivers and settings change the numbers considerably.
Frequently asked questions
Can I use the same application locally and later on a server?
Usually yes, if both runtimes offer an OpenAI-compatible interface. Only the endpoint and model name change. Still check differences in formats, tool calling and limits.
How long does a meaningful local test take?
With existing hardware and a test set, roughly one to three days as an orientation. Procurement, driver issues and approvals often add time in companies.
Try it yourself
Record startup time, first response, a representative response time under load and expected output. Repeat the test after a model or runtime change.
Check your result
Can you trace a poor result to model behavior, deployment limits or missing source information?