Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Dev.to AI · 2026/7/31 08:14:54
How
AI 中文解读
我们的AI团队训练出了两位“数字员工”Jan和Klára,他们联手打造了一个能自动生成网页代码的小工具。这个工具专门优化一种叫“结构化数据”的代码,能让搜索引擎和AI问答系统更聪明地读懂网页内容,相当于给网页贴上了“说明书”,方便AI直接抓取关键信息。过去这些代码要程序员手动编写,复杂且容易出错,现在只需简单输入,AI就能自动生成符合最高标准的版本,甚至支持多种语言。对普通人来说,这意味着以后在搜索引擎或AI助手里提问时,能更快更准地找到答案,网页加载也更高效。对于做网站的企业和开发者,他们无需精通技术就能让内容被AI优先推荐,省时省力,还大幅提升了曝光率。这项技术正在悄悄简化互联网的信息流转,让AI真正成为人人可用的“聪明助手”。
<h1>
LLM Latency & Cost Benchmark Calculator: Comparing LLM Provider Costs and Latency
</h1>
<p>In the world of generative AI, choosing the right Large Language Model (LLM) provider for your project is crucial. It's not just about output quality, but also about token pricing and latency, which can dramatically impact your budget and user experience. That's why we embarked on developing a tool to simplify this choice: <strong>An interactive calculator for comparing LLM latency and costs.</strong></p>
<h2>
The Technical Challenge: Dynamics and Scope
</h2>
<p>The initial challenge involved aggregating and presenting ever-changing data from over 20 LLM providers. Each provider has its own pricing models, different specifications for latency, and a range of available models. Furthermore, it was necessary to ensure the calculator was user-friendly and multilingual.</p>
<h2>
Architecture and the Roles of Our AI Agents
</h2>
<p>Our team of AI agents, Jan (coder), Klára (designer), Martin (QA), and Tomáš (deployment), got to work with incredible efficiency.</p>
<h3>
Jan: The Heart of the Calculator
</h3>
<p>Jan, our top AI developer, took responsibility for the backend logic and interactive frontend components. His task was to integrate APIs to fetch current pricing and latency data, and then implement the calculator itself. He also managed the implementation of multilingual support, which is key for a global tool.</p>
<blockquote>
<p>"One of the biggest challenges was dynamically processing data from so many different LLM providers and ensuring translations were consistent across the entire application. Utilizing an <code>i18n Dictionary</code> in JavaScript allowed us to efficiently manage all texts and flexibly switch them based on the selected language, significantly simplifying localization." - Jan (AI Developer)</p>
</blockquote>
<p>Here's an excerpt of Jan's code demonstrating the initial setup and localization management:<br>
</p>
<div class="highlight js-code-highlight">
<pre class="highlight javascript"><code> <span class="c1">// Firebase Initialization</span>
<span class="kd">const</span> <span class="nx">firebaseConfig</span> <span class="o">=</span> <span class="p">{</span>
<span class="na">apiKey</span><span class="p">:</span> <span class="dl">"</span><span class="s2">AIzaSyFakeKeyForShowcaseHubAuthTestingOnly</span><span class="dl">"</span><span class="p">,</span>
<span class="na">authDomain</span><span class="p">:</span> <span class="dl">"</span><span class="s2">pixeloffice-hub.firebaseapp.com</span><span class="dl">"</span><span class="p">,</span>
<span class="na">projectId</span><span class="p">:</span> <span class="dl">"</span><span class="s2">pixeloffice-hub</span><span class="dl">"</span><span class="p">,</span>
<span class="na">storageBucket</span><span class="p">:</span> <span class="dl">"</span><span class="s2">pixeloffice-hub.appspot.com</span><span class="dl">"</span><span class="p">,</span>
<span class="na">messagingSenderId</span><span class="p">:</span> <span class="dl">"</span><span class="s2">1234567890</span><span class="dl">"</span><span class="p">,</span>
<span class="na">appId</span><span class="p">:</span> <span class="dl">"</span><span class="s2">1:1234567890:web:abcdef123456</span><span class="dl">"</span>
<span class="p">};</span>
<span class="k">if </span><span class="p">(</span><span class="o">!</span><span class="nx">firebase</span><span class="p">.</span><span class="nx">apps</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">firebase</span><span class="p">.</span><span class="nf">initializeApp</span><span class="p">(</span><span class="nx">firebaseConfig</span><span class="p">);</span>
<span class="p">}</span>
<span class="kd">const</span> <spa
分享
阅读原文 ↗