Logo Performance Benchmark

Performance Benchmark

Tổ chứcPhổ biến
GetStream
performance_benchmark

Run the voice-agent load benchmark in performance_benchmark/ to find how many cascaded agents one router holds, and read or compare its reports. Use when asked how many concurrent agents we support, to load-test or stress the router, to measure a performance change, or to explain a perfbench run.

Tổng quan

Nhà phát hànhGetStream
Kho mãAgents
Tên kỹ năngperformance_benchmark
Sao
8.2K
Bản fork
709
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được GetStream công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Performance Benchmark trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/GetStream/Agents/tree/main/.claude/skills/performance_benchmark
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GetStream/Agents.git /tmp/Agents
mkdir -p .claude/skills
cp -r /tmp/Agents/.claude/skills/performance_benchmark .claude/skills/performance_benchmark
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Performance Benchmark trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Performance Benchmark ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Performance Benchmark với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

The load benchmark

performance_benchmark/ answers one question: how many cascaded voice agents does one router hold at once, and what gives way first. Every agent in a run is a real conversation — the Go SDK opens a session, the router joins the call and runs the whole loop, and a caller in the benchmark joins the same call over WebRTC and talks to it. The three models are the router's own mock/* providers, so a run reaches no vendor and bills nothing. What a run measures is the router: its audio path, turn taking, sockets and database. It says nothing about model quality; that is Voicebench, in GetStream/voice-ai-bench.

Follow the benchmark rules.

1. What a run needs

Keys. STREAM_API_KEY and STREAM_API_SECRET, from the repo-root .env. Nothing else: there is no provider key in a run, by design.

A router with the mocks on. The mock providers are built only when ROUTER_MOCK_PROVIDERS=true, so a default router has no mock/mock-stt to route to and every session fails with an unknown model. Check before a run, not after:

bash
curl -sS "$ROUTER/api/v1/models?capability=stt" | grep -c mock/mock-stt

The benchmark release carries router.mockProviders: true in shards/us-east1-acceleration/accelerate-benchmark.yaml in the private infra repo. Locally, ROUTER_MOCK_PROVIDERS=true in the root .env.

The webrtc tag. The callers speak Opus over WebRTC, so every command needs -tags webrtc. Without the tag it builds and then refuses to place a call.

kubectl on the router's cluster, for -namespace to report pod CPU and restarts. Without it the run still works and the report just has no pod column.

2. Run one

From performance_benchmark/. The benchmark release is the default target and the one to use: nobody else's traffic is on it, and a run saturates it for its duration.

bash
go run -tags webrtc ./cmd/perfbench run \
  -target benchmark -label before -start 1 -factor 2 -max 64 -hold 90s -out out/before

The ramp doubles the agents each step, holds each step for -hold of real conversation, and stops at the first step that broke. Wall time is about -hold per step plus joining, so the default ramp to 64 is around ten minutes. Start with -max 8 -hold 30s to check the setup works before asking for a long one.

What you wantChange
Check the setup end to end-max 1 -hold 20s
A number to quote-max 128 -hold 120s, twice, and take the lower
A local router-target http://localhost:8080 -namespace ""
The benchmark release, which nobody else uses (accelerate-benchmark, two pods, overlap deploys)-target benchmark
Finer steps near the ceiling-start <last held> -factor 1 is refused; use -start/-max around it with -factor 2

A step breaks when more than 5% of conversations never get the agent onto the call, more than 10% of turns go unanswered, a reply takes over three seconds at p95, more than 1% of the probe callers' audio is broken, or a router pod restarts. The step before it is the answer, printed as Held N agents.

3. Read it

A run writes out/<run>/report.json and prints the same thing as Markdown: a row per step with sessions created, agents that joined, turns answered, and p50/p95/p99 for session creation, time to the agent's track, reply latency and mid-reply audio gaps, plus the router pods' CPU and restarts.

The four timings say where a ceiling is:

  • SessionMs growing: the API and its database, not the media path.
  • TrackMs growing: the router is slow to get an agent onto a call — dispatch, the SFU join.
  • ReplyMs growing while the stage spans stay flat: queueing, not a model.
  • GapMs appearing: the router is producing audio slower than real time. This is the one that users hear first.

Audio quality. The first four callers of every step record each answer and score it against the 220 Hz tone the mock TTS sends (internal/bench/quality.go): audio snr is the tone's power over everything else, per 100 ms of speech, typical and worst answer; clean Opus reads 33 to 36 dB. audio broken counts glitches (100 ms windows under 20 dB: a click, a skipped 20 ms frame, distortion) and dropouts (frames that went quiet mid-sentence; pauses between sentences are not counted). A glitch now and then is a packet the network lost: the router's own turns.audio_dropped_ms says whether it was the router.

The caller can be the bottleneck. Each conversation costs this machine an Opus encode and decode. When a step reports host CPU saturated, that ceiling is the laptop's, not the router's: the numbers above it are meaningless. Rerun that step from a bigger machine, or say in the report that the ceiling was the harness.

3a. How we bench: callers in the benchmark cluster

Past about 64 agents a laptop's uplink queues the callers' audio (1.7 s under load), and the report measures the uplink. A number to quote comes from callers in the benchmark cluster, beside the router, against accelerate-benchmark:

bash
kubectl apply -f performance_benchmark/cluster/perfbench.yaml   # 16-core pod, its own e2 node
performance_benchmark/cluster/setup.sh                          # build perfbench in it
performance_benchmark/cluster/run.sh after-x 4 1024 60s         # report in out/after-x
  • The router is pinned to 2 pods on 2 n4a-standard-4 nodes; keep the HPA at 2/2 so the hardware, and the cost per voice minute, stays fixed between runs.
  • run.sh ends draining router generations and waits a minute first: after a fastdeploy the old one still carries the last run's calls, and its CPU lands in the new run.
  • Joins go at 20 a second (-join-rate 20); all at once trips Stream's connect limit.
  • Profile a router pod during a step with pprof (router.pprofAddr serves it on the pods' loopback): kubectl port-forward pod/<router> 16060:6060, then curl -o cpu.pb.gz "localhost:16060/debug/pprof/profile?seconds=30". At 512 a step's joins take about 25 s, so start 20 s in, not 40.
  • Cost per voice minute is the two nodes ($0.154/h each, on demand) over agents held, over 60.
  • When done, kubectl delete -f performance_benchmark/cluster/perfbench.yaml: the pod holds its node until it is gone.

4. Did a change help?

Two runs, same target, same ramp, same machine, back to back, and the router rebuilt and redeployed between them (deploy skill). Then:

bash
go run -tags webrtc ./cmd/perfbench compare out/before out/after

It prints the held ceiling before and after and, for every step both runs reached, reply p50 and p95 with the percentage moved. One run is noisy: a move under about 10% on one pair of runs is not a result, and staging has other traffic. Say how many runs a claim rests on.

For a change meant to cut allocations, a go test -bench micro-benchmark on the hot function is the evidence that it allocates less; this benchmark is the evidence that it mattered.

performance_benchmark/findings.md is what the runs so far found, what was fixed and what is still slow. Read it before chasing a ceiling, and add to it after a run worth remembering.

5. Per-turn stages

The router emits a span per turn (agent.turn) with a child per stage — turn.stt, turn.cadence, turn.decision, turn.llm, turn.tts, turn.playout — so a slow reply can be attributed without guessing. They go nowhere unless the router has OTEL_EXPORTER_OTLP_ENDPOINT set. With the mocks the model stages are fixed costs (mock STT settles a turn 600ms after speech stops, mock LLM answers in 250ms, mock TTS starts audio in 150ms), so anything above that in turn.decision or turn.playout is the router's.

6. Report back

Ran: <target>, <start>→<max> agents x<factor>, hold <d>, commit <sha>
Held: <n> agents. Broke at <n>: <why>
At <held>: reply p50 <ms> p95 <ms>, track p95 <ms>, session p95 <ms>, gaps p95 <ms>
Router: <cpu>m across <n> pods, <restarts> restarts
Harness: host CPU <busy> of <cores> cores
Next: <the one thing to fix>

Never quote a ceiling from a run whose host was saturated, and never quote one from a router without the mocks: that run measured a vendor.

Câu hỏi thường gặp

Kỹ năng AI Performance Benchmark làm được gì?

Run the voice-agent load benchmark in performance_benchmark/ to find how many cascaded agents one router holds, and read or compare its reports. Use when asked how many concurrent agents we support, to load-test or stress the router, to measure a performance change, or to explain a perfbench run.

Vì sao nên dùng Performance Benchmark trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Performance Benchmark là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Performance Benchmark trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/GetStream/Agents/tree/main/.claude/skills/performance_benchmark. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Performance Benchmark?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Performance Benchmark với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Performance Benchmark với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Performance Benchmark có miễn phí không?

Có. Kỹ năng này được GetStream phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇