Lattice
Skip to content

Volume, latency or cost constrained

A llm api stack.

LLM API · 100,000 req/mo. At the default case — 100k requests a month, no further constraints — drawn from the 112 tools already in the index. Each pick is a tool whose own skip-when is stated, because a stack built on tools it does not know how to overcommit to is a guess. Describe your case to change it.

The picks

  • Edge caching and latency dominate, on Cloudflare already.

    Watch out: Requests must not transit a third party's network.

    Consider Martian instead when routing tuned on your own traffic rather than a public benchmark

  • You are committed to NVIDIA hardware and need the last of the throughput.

    Watch out: Hardware portability matters, or you have no GPUs to tune against.

    Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box

  • Gateway-level observability with per-request cost and latency.

    Watch out: You need eval primitives more than traffic logs.

    Consider Langfuse instead when self-hostable tracing, prompts and evals in one place

The costs and the risks

Estimated cost
$40–$220
per month
A heuristic band from query volume, not a vendor quote.
Confidence
87%
Lower when constraints narrow the field, higher when the workload has a well-worn default.

Biggest risk at the default case: Prompt changes without evals are guesses. Version prompts and measure before routing or self-hosting.

Rules of thumb

  • Route on measured quality, not on price alone. A cheaper model that fails your eval set is not cheaper.
  • Benchmark at your concurrency, not at batch size one. A runtime that wins a single-stream demo can lose badly at fifty concurrent users.
  • Build the eval set before tuning anything. Every later decision in the stack is only as good as the measurement behind it.

Quick answers

What should you run for the LLM API stack?
Routing: Cloudflare AI Gateway. Inference: TensorRT-LLM. Evals: Helicone. Prompt changes without evals are guesses. Version prompts and measure before routing or self-hosting.
What should you use for routing in the LLM API stack?
Cloudflare AI Gateway: edge caching and latency dominate, on Cloudflare already. Watch out: requests must not transit a third party's network. Consider Martian instead when routing tuned on your own traffic rather than a public benchmark.
What should you use for inference in the LLM API stack?
TensorRT-LLM: you are committed to NVIDIA hardware and need the last of the throughput. Watch out: hardware portability matters, or you have no GPUs to tune against. Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box.
What should you use for evals in the LLM API stack?
Helicone: gateway-level observability with per-request cost and latency. Watch out: you need eval primitives more than traffic logs. Consider Langfuse instead when self-hostable tracing, prompts and evals in one place.
What does the LLM API stack cost per month?
$40–$220 a month at the default case: a heuristic band from query volume, not a vendor quote.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

A starting point, not a prescription. The recommendation at the default case is what the engine would tell a stranger with your workload; the recommendation at your case is what it tells you once it knows the constraints. The Stack Builder holds both — the builder link preselects this workload and starts with your volumes from here.