Week 5 · LLM gateways · about 3 minutes
What you will be able to do
Estimate cost per Knowledge Copilot request before the Helix Health demo.
The idea
Every request costs (input_tokens × in_price + output_tokens × out_price) / 1_000_000. Context from RAG multiplies the input side.
Before a demo, multiply expected questions by a high-end estimate. If the number scares you, shrink context or pick a smaller model first.
def request_cost(in_tokens, out_tokens, in_per_m, out_per_m):
return (in_tokens * in_per_m + out_tokens * out_per_m) / 1_000_000
# 2k in, 400 out at $5 / $15 per 1M → $0.016 per answer
assert round(request_cost(2000, 400, 5.0, 15.0), 4) == 0.016If you cannot estimate the demo bill, you are not ready to demo.
Key takeaways
- Cost = (in×in_price + out×out_price) / 1M.
- RAG context dominates the input bill.
- Estimate the demo before you run it.
Part of the Forward Deployed Engineer roadmap. New to the role? Start with what a Forward Deployed Engineer does.