Skip to main content
Botmartz AI Solution PVT LTD.
LLMS

Model Serving and Deployment: vLLM, TGI, Ollama, and On-Device Inference

Deploying LLMs requires specialized frameworks. vLLM and TGI optimize throughput with batching and paging. Ollama runs models locally. Choose based on latency/throughput needs.

SS
Soham Sharma
AI Engineer, Botmartz · July 17, 2026 · 1 min read
Read Time
1 min
Failure Modes
5
Code Snippets
3
Runnable Notebook
1
Model Serving and Deployment: vLLM, TGI, Ollama, and On-Device Inference

Serving LLMs requires specialized infrastructure. vLLM batches requests and pages KV cache. TGI (Text Generation Inference) optimizes throughput. Ollama runs models locally. Each framework optimizes different objectives: latency vs. throughput.

vLLM: High-Throughput Serving

vLLM batches requests and uses paged attention (like virtual memory for KV cache) to support high throughput.

Code Snippet
# Start vLLM server
python -m vllm.entrypoints.openai_api_server \
    --model meta-llama/Llama-2-7b \
    --tensor-parallel-size 2 \
    --gpu-memory-utilization 0.9

TGI: Text Generation Inference

TGI optimizes latency with continuous batching and speculative decoding.

Code Snippet
# Start TGI server
docker run --gpus all -p 8080:80 -v $MODEL_DIR:/data ghcr.io/huggingface/text-generation-inference:latest

Ollama: On-Device Inference

Run models locally without cloud infrastructure.

Code Snippet
# Install and run
ollama pull llama2
ollama run llama2 "What is 2+2?"

Ollama is ideal for privacy-sensitive applications, offline use, and development.

Conclusion

Model serving frameworks enable production LLM deployment. vLLM and TGI optimize cloud serving; Ollama enables local inference. Choosing the right framework depends on latency/throughput requirements and deployment constraints. Next: monitoring and observability for production LLM systems.

Closing Takeaways

✓
Measure retrieval precision and recall in isolation before touching the model.
✓
Chunk along document structure, not arbitrary character counts.
✓
Combine vector and keyword search — hybrid retrieval beats either alone.
✓
Treat evaluation as continuous infrastructure, not a launch-week report.
Try It Yourself
A runnable Google Colab notebook with the eval harness and hybrid search code from this post.
#LLMs#Deployment#vLLM#Inference Serving
0 views
SS
Soham Sharma
AI Engineer at Botmartz, building enterprise RAG and agent systems in production. Contributing to open-source libraries.

Discussion (0)

No approved comments yet. Be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *

More Engineering Insights
AI AGENTS
9 min read
AI AGENTS
11 min read
OPEN SOURCE
6 min read
AI ENGINEERING
8 min read
CASE STUDIES
14 min read