Vault 资讯瀑布媒体2026.10.03 23:30 UTC+8

EP228:SSH 如何工作

ByteByteGo 通讯第228期:图解 SSH 工作原理,并汇总提升 AI 系统效率的六大技术等本周系统设计要点。

获取一套最先进、完全组装好的智能体 harness。(赞助内容)

Strands harness 是开源、最先进、完全组装好的智能体 harness。安装完成的那一刻,它就是一个完整、可用于生产的智能体。在六项基准测试中,它的准确率与其他 harness 持平或更优,同时少用 28% 的 token。

你可以获得 shell、文件和网络工具,以及上下文管理、记忆和子智能体,全部已调优、开箱即用。每个默认值都可以由你更改。它可以作为库运行,也可以通过 strands CLI 运行,支持任何模型和任何云。它构建在开源 Harness SDK 之上,因此你可以扩展或替换任何部分。

开始使用

本周的系统设计回顾:

- SSH 如何工作

- 让你的 AI 系统高效的 6 大技术

- AI 智能体的解剖结构

- 你如何知道你的 AI 应用是否真的有效?

- 🚀 新课程:AI Evals in Practice 于 10 月 7 日开课

SSH 如何工作

安全 shell 是一种在非安全网络上安全访问远程机器的方法。它从 SSH 客户端到远程机器(SSH 服务器)的 TCP 连接开始。

两台机器交换 SSH 版本并协商加密算法,双方各自运行密钥交换协议。SSH 服务器发送公钥和签名,客户端机器进行验证。随后该主机密钥会与 known_hosts 文件进行比对。

两台机器随后各自在本地派生出会话密钥,不通过网络共享它们。相同的密钥,分别计算,从不上线传输。然后 SSH 客户端通过发送用于登录的公钥开始认证。

SSH 服务器在 authorized_keys 中匹配该公钥,SSH 客户端同时用私钥对认证请求签名,并将数字签名发送给 SSH 服务器。

私钥永远不会离开你的机器。服务器将用客户端公钥验证签名。至此 SSH 认证完成,会话开放以供通信。

让你的 AI 系统高效的 6 大技术

大规模服务 LLM 成本高昂。以下 6 种流行技术可降低延迟和成本,让你的系统更高效。

- 流式输出:模型一准备好每个 token 就立即发送。这将用户感知的延迟变为首 token 时间。

- 量化:将模型权重转换为 FP8 等更低精度。这种转换带来更少的内存占用,从而转化为更快、更便宜的服务。

- 连续批处理:借助该技术,一旦有空位,新请求就会被加入批次。因此 GPU 空闲更少。

- 前缀缓存:该技术缓存给定输入提示的内部计算。运行时,如果提示有已缓存的前缀,这些计算就会被跳过。

- 分页 KV 缓存:该技术将缓存存储在固定大小的块中,而不是一整块连续内存。运行时,块随序列增长而分配,因此内存不会被预先预留。

EP228: How SSH Works

Get a state-of-the-art, fully assembled agent harness. (Sponsored)

Strands harness is the open-source, state-of-the-art, fully assembled agent harness. It’s a complete, production-ready agent the moment you install it. Across six benchmarks it matched or beat other harnesses on accuracy while using 28% fewer tokens.

You get shell, file, and web tools, plus context management, memory, and subagents, all tuned and ready to use. Every default is yours to change. Run it as a library or from the strands CLI, on any model and any cloud. It’s built on the open-source Harness SDK, so you can extend or replace anything.

Get started

This week’s system design refresher:

- How SSH Works

- Top 6 Techniques to Make Your AI System Efficient

- The Anatomy of an AI Agent

- How do you know if your AI app actually works?

- 🚀 New Course: AI Evals in Practice Starts on Oct. 7

How SSH Works

Secure shell is a method to access a remote machine securely over an unsecured network. It starts with a TCP connection from the SSH client to the remote machine (SSH server).

Both the machines exchange the SSH versions and negotiate crypto algorithms, and each side runs a key exchange protocol. The SSH server sends the public key and a signature, which the client machine verifies. That host key is then checked against the known_hosts file.

Both the machines then derive session keys on their end and do not share them over the network. Same keys, computed separately, never put on the wire. Then the SSH client starts authentication by sending the public key for login.

The SSH server matches the public key in the authorized_keys, and the SSH client also signs the auth request with the private key and sends the digital signature to the SSH server.

The private key never leaves your machine. The server will verify the signature with the client public key. This completes the SSH authentication, and now the session is open for communication.

Top 6 Techniques to Make Your AI System Efficient

Serving LLMs at scale is expensive. These 6 popular techniques reduce latency and cost, and make your system more efficient.

- Streaming: The model sends each token as soon as it becomes ready. This changes the user’s perceived latency to time-to-first-token.

- Quantization: Convert the model's weights to lower precision like FP8. This conversion leads to less memory usage, which translates to faster and cheaper serving.

- Continuous batching: With this technique, new requests are added to the batch once a slot becomes available. Therefore, the GPU is less idle.

- Prefix caching: This technique caches internal calculations for given input prompts. At runtime, if the prompt has a cached prefix, those calculations are skipped.

- Paged KV cache: This technique stores the cache in fixed-size blocks instead of one contiguous chunk. At runtime, blocks are allocated as the sequence grows, so memory is not reserved up front.

- Speculative decoding: Here, a small model (speculator) proposes multiple tokens. After that, the main model verifies them in one forward pass.

Over to you: what is missing from this list?

[Webinar] How to stop babysitting your agents (Sponsored)

Agents can generate code. Getting it right for your system, team conventions, and past decisions is the hard part. You end up wasting time and tokens in the correction loops.

More MCPs, rules, and bigger context windows give agents access to information, but not understanding. The teams pulling ahead have a context layer to give agents exactly what they need for the task at hand.

Join us for a FREE webinar on Oct 7 to see:

- Where teams get stuck on the AI maturity curve and why common fixes fall short

- How a context layer solves for quality, efficiency, and cost

- Live demo: the same coding task with and without a context layer

If you want to maximize the value you get from AI agents, this one is worth your time.

Register Now

The Anatomy of an AI Agent

An AI agent can be thought of as a simple While-loop.

It uses an LLM to select an action, executes that action, evaluates the result, and repeats the process until the task is complete. Let’s take a closer look at each of these components:

- Brain: The LLM is the core. It reads the situation, thinks, and decides what to do next. The big shift from chatbot to agent: the model isn’t writing text anymore, it’s making choices.

- Planning: Hard tasks need more than one step. Agents break them down using methods like Chain of Thought (think step by step), Tree of Thoughts (try options, pick the best), or Reflexion (learn from mistakes and retry). Planning turns a fuzzy goal into clear actions.

- Tools: An LLM without tools is a brain in a jar. Tools are functions the model can call, like web search, code execution, APIs, files, or browsers (often using the MCP standard). The model requests a tool, the system runs it, and the result comes back.

- Memory: Without memory, every turn starts from zero. Short-term memory is the context window. Long-term memory lives in vector stores, files, and knowledge bases. When the window fills up, agents summarize old turns and carry the summary forward.

- Loop: All four pieces work together in a cycle. The agent looks at the current state, decides what to do, uses a tool, sees the result, and repeats. It keeps going until it gives a final answer.

- Guardrails: Not strictly anatomy, but important. Sandboxing, human checks, token limits, output validation, and scope limits keep autonomy from turning into expensive chaos. The more autonomy you give, the more these matter.

Over to you: when you build an agent, which of these five takes the most work to get right?

How do you know if your AI app actually works?

You evaluate it. But most teams skip this step (or do it wrong) because “eval” feels vague. It’s not.

Every good eval is a 3-step recipe.

Step 1: Pick a task. AI systems have different capabilities and dimensions to evaluate. For LLMs, it can be safety or math capability, in RAGs it can be grounding and retrieval, Pick one.

Step 2: Collect eval data. For every task, gather inputs paired with the right answer or expected behavior. A safety set pairs risky prompts with “refuse.”

Step 3: Develop a grader. How do you decide if the output is good?

- Use code-based graders (if/else, unit tests) for things with a clear correct answer and patch passing unit-tests.

- Use model-based graders (LLM-as-judge) for subjective tasks like safety.

- Use human graders for edge cases and anything where nuance matters more than throughput.

Most production evals combine all three. Code-based for what’s cheap to check. Model-based for scale. Human-based for what matters most.

Over to you: what’s the hardest thing about your task to grade, and which grader type do you use for it?

🚀 New Course: AI Evals in Practice Starts on Oct. 7

ByteByteGo has teamed up with Manjeet Singh, Senior Director at Salesforce, to bring you a live and hands-on course on building reliable evaluation systems for production AI agents.

Check it out Now

You’ll learn how to:

- Design evals for quality, safety, reliability, cost, and latency

- Build and validate LLM-as-a-Judge systems

- Red-team agents for prompt injection and jailbreaks

- Create meaningful eval datasets from real and synthetic data

- Evaluate tool use, RAG, multi-step execution, and multi-agent handoffs

- Run evals in CI/CD and production to catch regressions and drift

- Turn failures into permanent regression tests

If you’re building AI agents and asking, “How do I know this is actually ready to ship?” — this course is for you.

Check it out Now

查看原始发布