
后 API 时代架构:让 SaaS 不再因推理费用失血
建立在第三方 AI API 上的 SaaS 时代正在结束。这就是后 API 架构——微调本地模型、GGUF 部署、零按 token 成本——让 AI 功能变得有利可图。
第一代 AI 驱动的 SaaS 建立在第三方 API 之上。选择提供商,接入 SDK,一周内就能发布 AI 功能。快速而有效。
但这个架构有一个结构性问题:每个触及 AI 的客户操作都花你的钱。不是基础设施随用量扩展的钱,而是直接的、按 token 的、随每个请求线性增长的钱。
后 API 技术栈消除了这个问题。它用你控制的基础设施上运行的微调模型替代按 token API 调用,通过 OpenAI 兼容端点提供服务,你的应用代码几乎不需要改变。按 token 成本降至接近零。你的 AI 功能变得像数据库一样成本稳定。
后 API 技术栈四层架构
Layer 1:OpenAI 兼容客户端 — 你的应用代码触及的部分。关键洞察:它不需要改变。只需更改 base URL 和模型名称。
Layer 2:本地 API 服务器 — Ollama、llama.cpp 或 vLLM 暴露 OpenAI 兼容 API 端点。
Layer 3:微调模型 — GGUF 格式,7B-14B 参数,Q4_K_M 量化。使用 Ertas 自动化微调流程。
Layer 4:推理硬件 — GPU VPS(AU$400-1,500/月)、专用硬件(AU$3,000-8,000 一次性)或 CPU VPS(AU$80-300/月)。
12 个月成本对比
云 API(GPT-4o)12 个月总计:AU$198,000
后 API 技术栈 12 个月总计:AU$18,600
节省:AU$179,400。 更高量级时差距进一步拉大。
迁移不需重写应用
实际变更范围:
- 添加路由配置 — 50-100 行代码
- 添加本地 API 服务器 URL 为环境变量 — 1 行
- 更新模型名称引用
- 添加监控
不需要的变更:无提示词重写、无响应解析变更、无流式逻辑变更、无错误处理变更。典型 SaaS 产品的迁移工作量为 2-4 周一个工程师的时间。
Ship AI that runs on your users' devices.
Ertas early bird pricing starts at $14.50/mo — locked in for life. Plans for builders and agencies.
延伸阅读
Ship AI that runs on your users' devices.
Early bird pricing starts at $14.50/mo — locked in for life. Plans for builders and agencies.
Keep reading

SLM-First Architecture: The 80/20 Routing Strategy That Cuts AI Costs 75%
Most AI features don't need GPT-4. An SLM-first architecture routes 80% of requests to fine-tuned local models and 20% to cloud APIs — cutting costs by 60-75% while maintaining quality.

AI-First SaaS Unit Economics: The Margin Math Every Founder Gets Wrong
Traditional SaaS enjoys 80-90% gross margins. AI-first SaaS averages 25-60%. Here's the margin math that separates profitable AI products from ones bleeding on inference costs.

Model Routing in Production: When to Use Fine-Tuned vs API vs RAG
Fine-tuning, RAG, and cloud APIs each solve different problems. Here's a practical routing framework for choosing the right approach per request — and how to combine all three in one system.