LLMBridge: 在以提示词为中心的互联网中降低访问大语言模型的成本
LLMBridge: Reducing Costs to Access LLMs in a Prompt-Centric Internet
AI总结:
本研究提出面向成本敏感用户的大语言模型代理LLMBridge,通过模型选择、上下文管理、语义缓存优化成本,在两个真实场景部署验证,分析了成本、延迟与质量的权衡。
摘要:
当今的互联网基础设施以基于HTTP的内容检索为核心,中间盒(如HTTP代理)在性能、安全性和成本效益方面发挥着关键作用。我们设想未来的互联网通信将以发送给生成式AI模型的“提示词”为主导。为此,我们需要具备与HTTP代理类似功能(如缓存、路由、压缩)的代理,同时应对基于提示词的通信所特有的挑战与机遇。作为支持基于提示词通信的第一步,我们提出了LLMBridge——一款面向有成本意识的用户(如发展中地区用户和教育领域用户,包括学生、教师)的大语言模型代理。LLMBridge支持三项核心优化:模型选择(将提示词路由至最合适的模型)、上下文管理(智能减少上下文数量)以及语义缓存(利用本地模型和向量数据库响应提示词)。这些优化会带来成本与质量之间的权衡,应用程序可通过一个高层的双向接口来协调这种权衡。作为案例研究,我们在两个对成本敏感的场景中部署了LLMBridge:一项基于WhatsApp的问答服务和一个大学课堂环境。该WhatsApp服务已上线超过12个月,服务了100多名用户,处理了超过1.47万次请求。与此同时,我们在一个学期内向三门计算机科学课程的学生开放了LLMBridge,它支持了多种由大语言模型驱动的应用(如推理智能体和聊天机器人),平均每天处理500次请求。我们报告了这两个场景下的部署经验,并利用收集到的工作负载对各类成本优化策略的有效性进行基准测试,分析它们在成本、延迟和响应质量方面的权衡关系。
英文摘要:
Today's Internet infrastructure is centered around content retrieval over HTTP, with middleboxes (e.g., HTTP proxies) playing a crucial role in performance, security, and cost-effectiveness. We envision a future where Internet communication will be dominated by "prompts" sent to generative AI models. For this, we will need proxies that provide similar functions to HTTP proxies (e.g., caching, routing, compression) while dealing with unique challenges and opportunities of prompt-based communication. As a first step toward supporting prompt-based communication, we present LLMBridge, an LLM proxy designed for cost-conscious users, such as those in developing regions and education (e.g., students, instructors). LLMBridge supports three key optimizations: model selection (routing prompts to the most suitable model), context management (intelligently reducing the amount of context), and semantic caching (serving prompts using local models and vector databases). These optimizations introduce trade-offs between cost and quality, which applications navigate through a high-level, bidirectional interface. As case studies, we deploy LLMBridge in two cost-sensitive settings: a WhatsApp-based Q&A service and a university classroom environment. The WhatsApp service has been live for over twelve months, serving 100+ users and handling more than 14.7K requests. In parallel, we exposed LLMBridge to students across three computer science courses over a semester, where it supported diverse LLM-powered applications - such as reasoning agents and chatbots - and handled an average of 500 requests per day. We report on deployment experiences across both settings and use the collected workloads to benchmark the effectiveness of various cost-optimization strategies, analyzing their trade-offs in cost, latency, and response quality.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。