Please turn JavaScript on

SegmentFault 思否

Following SegmentFault 思否's news feed is very easy. Subscribe using the "follow" button on the top right and if you want to, choose the updates by topic or tag.

We will deliver them to your inbox, your phone, or you can use follow.it like your own online RSS reader. You can unsubscribe whenever you want with one click.

Keep up to date with SegmentFault 思否!

SegmentFault 思否: SegmentFault 思否

Is this your feed? Claim it!

Message History

好像不同模型的缓存率不一样?大家都是怎么判断自己选的大模型的缓存率高低啊

主要是看了一些报告,但实操性不强


Read full story

我的代码目的是想按单词的出现次数降序排列,但是输出结果与未排序前一样,我想知道为什么。

words = ['a', 'b', 'a', 'c', 'b', 'a'] words.sort(key=lambda w: -words.count(w)) print(words)

输出结果:

PS D:\Code> & C:\Users\27751\AppData\Local\Programs\Python\Python313\python.exe d:/Code/python.py ['a', 'b', 'a', 'c', 'b', 'a']

期望结果:想按单词的出现次数降序排列
实际结果:与未排序前一样


Read full story

开发 Agent 时,RAG 检索到底应该设计成 Tool 还是 Node?

最近在做一个企业级 RAG Agent,技术栈主要是 Python + LangGraph,Agent 需要完成知识库检索、问题分析、多轮推理、工具调用以及最终回答。

目前在设计 Agent Workflow 时遇到了一个比较纠结的问题:

RAG 检索到底应该作为 Agent 的 Tool,还是作为 Workflow 中独立的 Node?


Read full story

标题:大三,想做个C++高性能LLM网关当求职项目,思路推演了一轮,求各位指点下有没有走偏
背景:大三在读,之前做过两个个人项目(epoll+Reactor的RPC框架、类Redis内存KV存
储),有一段支付后端实习(MySQL/FastAPI)。秋招想投C++后端/基础架构方向,打算把两
个旧项目合并升级成一个有真实场景的项目。
推演过程(这个是和AI讨论的结果)1.最初想做"多智能体消息总线”,研究了一圈发现站不住:Claude Code、Codex、OpenClaw的agent通信都停在应用层,因为真实瓶颈是LLM推理延迟,不是消息传输一-高性能总线是伪需求;
Python字典就够了;
2.又想退回到”LLM结果缓存",发现更站不住:缓存查找相对LLM调用是零头,GPTCache...


Read full story

项目里要访问一个只能通过 SOCKS5 出去的接口,Node 端用的是 18+ 自带的全局 fetch(undici 实现)。卡在代理上:undici 提供的是 ProxyAgent,只认 HTTP/HTTPS 代理,没有 SOCKS5 支持。

试了几种把全局出口改成 SOCKS5 的写法,都没能让内置 fetch 走代理:

// 1) 直接把 ProxyAgent 指到 socks5 import { setGlobalDispatcher, ProxyAgent } from 'undici'; setGlobalDispatcher(new ProxyAgent('socks5://127.0.0.1:1080')); // → 协议不被识别 // 2) 环境变量 // HTTPS_PR...

Read full story