Wiki: Optimizing the Deployment of LLMs for Cost Efficiency
For agents: Markdown version · Wiki index · Explore
- Speaker: Michael Levinger
- Event: Reversim Summit 2025
- Video: https://www.youtube.com/watch?v=BgJsdS9bLTg
- Transcript: /transcripts/2025/09-BgJsdS9bLTg.md
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: AI and LLMs, Machine Learning, Performance, MLOps
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
This talk explores strategies for optimizing the deployment costs of large language models and AI agents in production. The speaker shares a real-world case study of building a fraud detection agent to prevent account takeover attacks. By implementing techniques such as model cascading, semantic caching, history handling, and prompt compression, organizations can significantly reduce API and infrastructure expenses. The audience learns practical methodologies to maintain a positive return on investment when scaling generative AI projects.
Key points
- 2:21 The speaker introduces a generative AI agent project designed to simulate risk analysts and detect payment fraud.
- 3:30 Many generative AI projects fail to achieve a positive return on investment if cost management is ignored from the start.
- 5:38 Defining clear performance metrics such as precision, recall, latency, and throughput helps establish a good-enough threshold for model selection.
- 7:57 Implementing a model cascade or router allows simpler requests to be handled by cheaper models while routing complex tasks to advanced models.
- 9:00 Semantic caching stores previous questions and answers in a vector database to serve frequent queries without making external API calls.
- 11:12 Managing conversation history by trimming old turns or summarizing previous interactions prevents token counts from growing excessively.
- 12:24 Prompt compression libraries can shorten system prompts while preserving key instructions to reduce token volume.
- 13:27 Advanced techniques like model distillation and quantization can further optimize open-source models for production efficiency.
Takeaways
- Establish clear performance metrics and cost constraints before starting any generative AI project.
- Implement a model cascading strategy to route queries based on complexity and confidence levels.
- Use semantic caching to intercept repetitive queries and eliminate redundant model calls.
- Monitor token usage and application costs continuously to avoid unexpected budget overruns.
Questions this talk answers
- How can I reduce LLM inference costs without sacrificing response accuracy?
- What is the difference between model cascading and semantic caching for LLM applications?
- How do I manage growing chat history contexts in conversational AI agents?
Technologies
Claude, GPT-4
Tags
ai agents, fraud detection, llm cost optimization, model cascading, production ml, prompt engineering, semantic caching