最近把自己的 AI Coding Agent 记忆底座迁移到了自建的 OpenViking 上。官方文档看着挺吓人,动辄推荐高配服务器和本地显存,实际上用下来,只要选型想清楚,一台几十块钱的入门级云服务器完全能跑得飞起。
这篇不是教你怎么敲命令的安装教程,只是聊聊折腾这一圈下来,在云主机、模型组合、算力开销上的一些真实心得和踩坑取舍。
1. 云主机:为什么我选 99 元的 2G,不选友商更便宜的 4G?
买云服务器时,第一眼很容易被一些友商“几十块钱买 4G 甚至 8G”的新客促销吸引。但我最终还是选了阿里云 99 元/年的 2核2G(ecs.e-c1m1.large)。
核心原因就一个:算长期的续费账,避开“首年低价、次年暴涨”的套路。
如果只是搭个无状态的个人博客,一年一换、到处搬家无所谓。但 OpenViking 是你的记忆数据库,里面存的是日常所有的会话轨迹、沉淀的项目架构、实体图谱和向量索引,是强状态资产。很多友商首年 60 块,第二年续费直接跳到 600、800 甚至上千,一年后为了省钱被迫停机、跨云拷贝几千兆数据、重新配安全组和域名解析,折腾成本远超那点差价。
阿里云这款活动最大的诚意,是保证来年依然可以 99 元无套路同价续费。
2G 内存虽然紧凑,但只要做好 Swap 兜底,限制好容器内存,并把计算全都甩给外部 API,机器本地只做存储检索,日常内存占用常态也就几百兆。拿稍微调优一下系统为代价,换一个每年只要 99 块、不用频繁搬家的稳定记忆底盘,这笔账怎么算都更划算。
2. 向量模型(Embedding):花钱的大头,必须一步到位
整套系统跑起来,持续花钱的大头其实就是向量模型。但我从一开始就放弃了“白嫖免费模型”的想法,坚定选择花钱买商业服务,并且要“一步到位”。
为什么必须一步到位?
VLM、意图分析、重排模型这些都是即时推理,今天觉得不好用,改一行配置重启一下直接就换了。但向量模型决定了数据库底层的空间几何特征。一旦以后你想换向量模型,哪怕输出维度一模一样,之前的向量也全都废了,必须全库全量重建索引(Re-index)。随着记忆越积越多,二次重构的代价和停机风险极高,所以向量模型选型必须一开始就选最好的。
为什么放弃 SiliconFlow 免费的 BGE-M3?
很多教程推荐用硅基流动上免费的 BGE-M3。我们在实际做向量召回测试时发现,它的召回质量被新一代模型拉开了非常明显的代际差距。BGE-M3 是 2024 年 1 月的模型,底子太老,而且是个纯文本模型,图片只能当附件存,根本建不了索引,做不到“以文搜图”。
更关键的是,公用免费池已经被羊毛党挤烂了。我们在测试免费模型做路由时频繁遇到丢包、高延迟、无响应。作为核心基础设施的底座,把身家性命系在免费公共池上,纯属给自己找麻烦。
为什么选火山方舟的豆包 Vision(0.7元),没选阿里千问?
最终我用的是火山方舟的 doubao-embedding-vision-251215,官方定价是推理输入 0.7 元 / 百万 tokens。
其实阿里百炼也有一款多模态向量模型(qwen3-vl-embedding),价格一模一样也是 0.7 元,但两者有个致命差距:
- 阿里千问的上下文窗口只有 32K;
- 火山豆包的上下文窗口高达 128K。
对于 Agent 场景,经常要塞入长篇开发规范、长上下文代码切片或者多张高清截图,128K 带来了整整 4 倍的安全容限,彻底不用担心超长切片溢出。加上 OpenViking 本身就是字节火山引擎开源的,原生 Provider 兼容最稳,同价位下显然选 128K 的豆包。
注:如果你完全没有图片、截图的检索需求,只做纯文本或代码笔记,阿里百炼的纯文本向量 qwen3.7-text-embedding 是个很好的省钱备选,价格只要 0.5 元/百万 tokens。
3. 意图分析(Query Planner):90% 的人都漏看的“隐藏开关”
很多人刚用 OpenViking 时都有个共同的困惑:“为什么这玩意儿响应这么迟钝?每次在 IDE 或终端里刚敲完一句话,光标都要卡顿个五六秒才开始有反应?”不少人甚至因此觉得是机器配置不够,或者系统本身设计笨重。
其实根本不是性能问题,而是绝大多数人压根没仔细看配置文档,不知道还能单独配一个意图分析模型。
官方默认示例里大家一般只填 vlm 和 embedding。但只要没在配置里显式声明 query_planner,OpenViking 在处理每一轮对话时,就会默认回退去调用主模型 VLM 来分析这轮对话是不是闲聊、要不要搜记忆、怎么提取关键词。如果你的 VLM 选了个大模型或者带思考链的模型(比如智谱 glm-5.3-flash),单次前置分析直接就能吃掉 6~7 秒,前端交互自然卡成 PPT。
为了解决这个前置卡顿,起初我试图在主流的通用大模型里寻找替代方案。但跑了一圈下来非常沮丧:
- 阿里百炼官方的 Qwen3.7-Flash 默认带深度思考,跑一次要想 10 秒;
- 硅基流动上的 Qwen/Qwen3.5-9B 吞吐偏慢(常态 30 tok/s),每次提问依然要停顿 4 秒;
- 硅基流动上的 Qwen/Qwen2.5-7B 格式飘忽,爱吐裸数组;
- 硅基流动公用免费池的模型(如 Qwen3.5-4B)更是被羊毛脚本挤爆,频繁丢包超时。
正当我们卡在通用大模型的选型瓶颈时,我在阿里百炼模型广场里无意间翻出了一个宝藏模型——tongyi-xiaomi-analysis-flash(伶鹊-对话分析-flash)。官方介绍写得很朴实:专攻对话信息抽取、场景分类与低时延分析的领域模型。
我立刻把它拉进测试矩阵,和前面的候选模型来了一场同台竞技。需要特别说明的是,为了公平对比,我们在压测所有候选模型时,全都显式关闭了思考模式(开启非思维链模式,纯直接输出)。
在实际评估中,我们重点死磕了三个核心维度:响应耗时、生成结构、规划表现。在三项严苛检验下,这个意外淘到的宝藏模型给出了教科书级的表现:
维度一:响应耗时(时间预算必须死守在 1 秒内)
query_planner 处于用户敲下回车、模型真正回答前的**关键阻塞路径(Critical Path)**上,耗时哪怕多 1 秒,体感都是极其明显的卡顿。
- 阿里百炼 Qwen3.7-Flash:即使关掉思考模式(enable_thinking: false),单次分析依然要 1.11.4 秒(7090 tok/s),作为高频前置拦截还是略重;
- 硅基流动 Qwen/Qwen3.5-9B:关掉思考后,受限于供应商 30 tok/s 的生成吞吐瓶颈,跑完一段多轮分析依然需要 3.8 ~ 4.2 秒;
- 硅基流动免费池(如 Qwen3.5-4B):公用免费池常年被羊毛脚本挤占,延迟严重抖动甚至直接超时;
- 通义伶鹊(Flash):首字延迟(TTFT)仅 0.31 秒,生成吞吐高达 200+ tok/s,整轮规划耗时直接干到了 0.8 秒左右,完美落在亚秒级预算内。
维度二:生成结构(严苛遵循 OpenViking 要求的 JSON 协议)
OpenViking 底层的意图解析器对输出格式有明确的契约要求:模型必须返回形如 {"queries": [...]} 的标准 JSON 对象结构(由内部代码直接反序列化提取检索意图),容不得半点格式偏差:
- 通用大模型的通病:喜欢画蛇添足加礼貌用语(“好的,为您规划如下”),或者在外面套一层 json ... 围栏,把本该干净的输出搞得拖泥带水,全靠系统写正则兜底去清洗;
- 硅基流动 Qwen/Qwen2.5-7B 的硬伤:虽然速度压缩到了 1.8 秒,但格式极其不服从规范,经常丢掉 OpenViking 要求的顶层 Key,直接吐出一个裸数组 [...]。一旦丢了对象结构,极易触发解析异常导致检索失败;
- 通义伶鹊(Flash):官方特性主打“自定义分析标准遵循”,实测下来对 OpenViking 要求的 JSON 协议做到了 100% 严格执行——输出纯净裸 JSON,没有 markdown 围栏,没有前后废话,与 OpenViking 的反序列化契约严丝合缝。
维度三:规划表现评估(业务意图的决断质量)
意图分析模型绝不是盲目生成检索词,它必须具备清晰的业务场景决断力:
- 闲聊拒搜率:面对“你好”、“谢谢”、“帮我写个冒泡排序”这种无需长程记忆介入的输入,通义伶鹊能像防火墙一样在 0.4 秒 内果断断定无需检索,并输出空数组 {"queries": []},避免了无意义的向量库查询与上下文污染;
- 多轮指代消解与实体抽取:在多轮对话中(比如用户追问“把刚才说的那个服务端口发我”),它能从历史上下文里把代词精准还原成具体的实体词(展开为“OpenViking 1933 端口配置”),提取出来的 Query 极其精准紧凑,绝不发散脑补。
事实证明,这个无意间淘到的宝藏模型绝非侥幸胜出,而是其专攻“对话抽取、场景分类、格式遵循”的垂直微调定位,正好与 OpenViking 前置路由的工程诉求完成了教科书般的精准对齐。
4. 重排序(Rerank)与 VLM:务实的经济账与容灾
最后说说剩下的两个组件:
- 重排序(Rerank):我依然放在了硅基流动上,用的是 Qwen/Qwen3-Reranker-4B。
之所以用它,是因为它走的是轻量商业计费通道(避开了免费池的排队),调用一次只要几厘钱。关键是我账号里还有送的 16 块钱代金券,不用白不用。实测 4 条文档打分 0.26 秒,30 条文档打分 0.57 秒,速度快而且打分很准,性价比拉满。
- VLM(多模态语义抽取):用的是智谱 Coding 套餐里的 glm-5.3-flash,顺便配了双 Key 主备容灾。
这里有个极其关键的实战经验:配置里一定要把思考模式显式改为 reasoning_effort: "low"。
我们专门做过多组 A/B 实测,默认不传参或者设为 high 时,模型会先深度思考大几十秒(耗时 2048 秒,生成上千个无意义的思维链 Token),而最终提取出来的实体和概览内容与 low 几乎毫无区别。记忆提取本质上是信息抽取和结构化归档,根本用不着复杂的数学逻辑推演,开 high 纯属白白浪费时间和算力。
即使设为 low,单次抽取依然需要 46 秒(有底层基础思考和 20~30 tok/s 的吞吐上限),它也是目前系统唯一的耗时点。但因为 VLM 只在后台异步做会话归档和概览生成,完全不阻塞前端的提问交互;加上 Coding 套餐按年付费极度便宜,配合双 Key 容灾非常稳定,现阶段完全不需要花钱折腾换它。
5. 写在最后的一些大白话心得
折腾完这套配置,最大的几点感悟:
- 状态型服务,买服务器先看续费:做长期记忆库,宁可前期在 2G 上花点时间调优,也别为了贪图首年几块钱的便宜去买续费暴涨的机器,搬家真的很累。
- 核心资产一步到位,无状态节点随时优化:向量模型决定了你的底层空间,别贪免费,多模态 + 大上下文(128K)直接锁死,避免以后二次重建;而 VLM 和 Rerank 这种纯推理节点,谁快谁便宜就换谁。
- 专用小模型在垂直场景吊打通用大模型:意图分析这种讲究“分类、提取、严格 JSON 格式、极速”的任务,微调过的对话分析小模型比动不动就写小作文、开思考链的通用大模型好用太多倍。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Recently moved its AI Coding Agent Memoratorium to a self-built OpenViking. The official document, which looked scary, was very quick to recommend high-quality servers and local VRAM, and was actually used, as long as the selection was clear, an entry-level cloud server of several dozen dollars could run.
It's not about how you knock on the command installation, it's about how this circle goes down, some real hearts and pits on the cloud host, model combination, calculation costs.
1. Cloud Host: Why do I choose two Gs for $99, not four Gs cheaper for friends?
When buying a cloud server, it's easy to be attracted to a few friends who buy 4Gs or even 8Gs. But I finally chose Alibaba Cloud 99 for 2 cores of 2G (ecs.e-c1m1.large).
One of the core reasons is the long-term renewal of the accounts, avoiding the “low first year, boom the following year”.
It doesn't matter if you change and move around every year. But OpenViking is your memory database, which contains all daily session tracks, sedimentary project structures, physical mapping and vector indexes, and is a strong asset. Many of our friends went straight to 600, 800 or thousands of dollars in their first year of business, and one year later they were forced to stop, copy thousands of mega-data across the clouds, reset security groups and decipher domain names, at far higher cost than that.
Alibaba Cloud is the best of good faith to ensure that there will still be 99 won for the next year.
2G RAMs, though compact, can only be filled with Swap, restricted to container RAMs and dumped all of the calculations to external APIs, with the machine doing storage search locally and daily memory occupancy normals of hundreds of times. At the expense of a little modulation of the system, a stable memory chassis with 99 bucks a year, without frequent moves, would be more profitable.
2. Vector model (Embedding): The big cost must be in place one step at a time
The whole system runs, and the big thing that keeps spending is a vector model. But from the outset, I gave up the idea of a “free access free model” and firmly chose to pay for commercial services and to “take it in one step”.
Why must one step be taken?
VLM, intent analysis, and reordering models are all instantaneous reasoning, which is not working today. However, vector models determine the spatial geometry at the bottom of the database. Once you want to change the vector model in the future, even if the output dimensions are the same, all the previous vectors are wasted and the full inventory must be re-established. As memory accumulates, the cost of a secondary re-engineering and the risks of shutdown are extremely high, so the vector model selection has to be the best from the beginning.
Why give up SiliconFlow for free BGE-M3?
Many courses recommend BGE-M3 free of charge on the movement of silicon. When we actually did the vector recall test, we found that its recall quality was being pulled by a new generation of models to open a very clear intergenerational gap. BGE-M3 is a January 2024 model, too old, and a pure text model, and pictures can only be stored as attachments, cannot be indexed at all, and cannot be "written."
More importantly, the public free pool has been crushed by the wool. When we test free models for routers, we often encounter lost bags, high delays and no response. As the base of the core infrastructure, the life of the family is tied to a free public pool, which merely causes itself trouble.
Why Doubao Vision of the Volcanic Ark?
I ended up using the doubao-embeding-vision-251215 of the volcano ark, and the official pricing was a reasoning input of $0.7/million tokens.
There's actually a multi-mode vector model in Alibri, and the same price is 0.7, but there's a fatal gap between them:
- The context window of Ali is 32K;
- Volcano Doubao has context window up to 128K.
For the Agent scene, there is often a requirement to enter long development protocols, long context code slices or multiple high-level clearances, and 128K brings a total of four times the security margin, without fear of spilling out of a long slice. Plus OpenViking itself is the open source of byteVolcengine, the original Provider is the most stable, and Doubao is apparently selected at the same price.
Note: If you don't have any search needs for pictures, screenshots, only plain text or code notes, the pure text vector of qwen 3.7-text-embeding is a good cost-saving option, at a price of 0.5 dollars per million tokens.
Intent analysis (Query Planner): "hidden switches" missed by 90% of the population
A lot of people just used OpenViking to get confused: "Why is it so slow?" Every time a word is struck in an IDE or terminal, it takes Cardon five or six seconds to react?" A lot of people even feel that the machine is not equipped enough, or that the system itself is too heavy.
It's not really a question of performance at all, but it's a fact that the vast majority of people do not look closely at the configuration document and do not know that they can be equipped with a single intent analysis model.
In the official default, you usually fill only vlm and embedding. But as long as it's not visible in the configuration query planner, OpenViking defaults on rollback to call the main model VLM to analyze whether this conversation is casual, whether to search for memory, how to extract keywords. If your VLM selects a model with a LLM or a thought chain (e.g. Zhipu glm-5.3-flash), a single pre-analysis can eat 6-7 seconds and the front-end interactive natural card is PPT.
At first, I tried to find an alternative in the mainstream generic LLM in order to solve the problem. But running around was very frustrating:
- The Qwen 3.7-Flash default for deep thinking, running for 10 seconds at a time;
- Slow swallowing (normal 30 tok/s) of Qwen/Qwen3.5-9B on silica flow, with a standstill of 4 seconds per question;
- The Qwen/Qwen2.5-7B format on the silica flow, which is drifting and profane;
- Silicon-based mobile public free pool models (e.g. Qwen 3.5-4B) are often crushed by wool scripts and often thrown away with timeout.
As we were stuck with the selected bottlenecks of General LLM, I accidentally flipped a treasure model — tongyi-xiaomi-analysis-flash (伶鹊-dialogue-flash). The official presentation was very simple: an area model dedicated to the extraction of dialogue information, the classification of scenes and the analysis of low latency.
I immediately pulled it into the test matrix, and there was a competition with the previous candidate model. It is particularly important to note that, in order to compare fairly, all of the candidate models that we have tested have been significantly closed down (opening the non-lined mode of thinking, purely direct output).
In practical assessments, we have focused on three core dimensions: response time-consuming, generation structure, planning performance. Under three harsh tests, this unexpectedly found treasure model gives a textbook grade:
Dimension 1: Response time-consuming (time budget must remain within 1 second)
Query planner is on a critical barrier path ** before the user knocks back and the model actually answers **, which takes even one second, and is extremely visible.
- Qwen3.7-Flash: even if the mode of thinking is shut down, the single analysis takes 1.11.4 seconds (7,090 tok/s) and the pre-interception as HF is slightly heavy;
- Silicon-based flow Qwen/Qwen3.5-9B: after turning off the thought, limited to 30 tok/s of the supplier generation bottleneck, which still takes 3.8 ~4.2 seconds after a multiple round of analysis;
- Silicon-based mobile free pool (e.g. Qwen3.5-4B): the public free pool is often squeezed by wool scripts, delays in severe shaking and even direct timeout;
- Qwen (Flash): The first word delay (TTFT) is 0.31 seconds, generating up to 200+tk/s, and the whole cycle of planning takes about 0.8 seconds and falls perfectly within the subsecond budget.
Dimension two: Generate structure (JSON protocol strictly following OpenViking)
OpenViking has a clear contractual requirement for output formats: the model must return to a standard JSON object structure (directly inverse sequenced retrieval intent by internal code), which does not allow half-point formatting deviations:
- General LLM ' s general illness: prefers to draw snakes in more polite language ( "Okay, here's the plan for you"), or lays a json... fence outside, drags clean outputs with mud and water, all on the back of the system;
- Silicon flow Qwen/Qwen2.5-7B hard wound: Although the speed has been compressed to 1.8 seconds, the format is extremely insubordination and often throws out the top layer of OpenViking's requirements, and throws out a nudity array [...]. Once the object structure has been lost, it is very easy to trigger a resolution anomaly leading to failure of retrieval;
- Qwen (Flash): The official identity is “self-defined analytical standards are followed” and 100% of the JSON protocol required by OpenViking has been measured to be strictly enforced - the export of pure nudity JSON, no markdown fence, no back-and-back bullshit, and the anti-serialization contract with OpenViking has been soared.
Dimension III: Planning performance assessment (judgmental quality of business intentions)
Intent analysis models are by no means blindly generating search words; they must have a clear operational context:
- Non-retroactivity: in the face of "hello", "thank you" and "blow me up" input that does not require long-term memory intervention, Qwen is able to determine decisively, in 0.4 seconds, as a firewall, that there is no need to search, and to output empty arrays {"queries":[}, avoiding meaningless database queries and context contamination;
- Multi-wheeling refers to decomposition and physical extraction: in multi-wheel conversations (e.g., when users ask for “transmit me to the service port that you just said”) it is able to refine the pronoun from the historical context to the specific entity word (expanding to “OpenViking 1933 Port Configuration”), extracting Query is extremely precise and compact and does not blow out the brain.
This unwitting treasure model, which has proved to be more than a success, is a vertical fine-tuning of its “dialogue extraction, scene classification, format adherence”, which coincides with the engineering claims of OpenViking.
Rearrangement (Rerank) and VLM: Practical economics and disaster management
Finally, the two remaining components:
- Rearranged (Rerank): I'm still on a silica flow using Qwen/Qwen3-Reranker-4B.
It was used because it followed a light commercial billing route (with a free pool out of line) and called for a few cents at a time. The point is, I still have 16 dollar vouchers in my account. Four documents are measured to score 0.26 seconds, 30 documents to score 0.57 seconds, fast and accurate, with full value.
- VLM (multi-mode extraction): glm-5.3-flash from the Zhipu Coding package, accompanied by two Key masters.
And here's one of the most critical operational experiences: it's important to make the thinking pattern visible.
We've done several sets of A/B measurements, and when defaulting on not being involved or set to high, the models think in depth for dozens of seconds (2048 seconds, generating thousands of meaningless lines of thought token), and the entity and overview that eventually comes out is almost the same as the low. Memory extraction is essentially information extraction and structured archiving, without the need for complex mathematical logic, and high is simply a waste of time and calculation.
Even if set to low, single extraction takes 46 seconds (with bottom base thinking and a maximum of 20~30 tok/s swallowing), it is the only time-consuming point of the current system. But since VLM is only able to file and produce an overview of sessions from the back stage, there is no obstacle to cross-examination at the front end; plus the Coding package is extremely cheap every year, paid, and double Key is very stable, and there is no need at this stage to spend any money on it.
5. Writing in the last words
After this configuration, the biggest things are:
- State-of-the-art services, first-renewal fees for servers: it's really exhausting to do long-term memory, rather than spend a bit of time on 2Gs in advance, and not to buy expensive machines for the first few dollars.
- Core assets are in place one step at a time and no-state nodes are optimized: vector models determine your bottom space, don't be greedy for free, multi-modular + Big context (128K) is locked to the ground and avoid subsequent reconstructions; and VLM and Rerank, this pure reasoning node, trade for anyone who gets cheap.
- Specialized mini-models are applied vertically to the generic LLM: the general LLM, which is intended to analyse this type of task “classification, extraction, strict JSON format, extreme speed”, is much more useful than writing small writings without moving.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.