Skip to content

test: compare LLM HTTP gateways under equal resource budgets - #1205

Merged
PurpleCHOIms merged 15 commits into
mainfrom
experiment/llm-http-comparison-20261117
Nov 17, 2026
Merged

PurpleCHOIms merged 15 commits into
mainfrom
experiment/llm-http-comparison-20261117

Conversation

@PurpleCHOIms

@PurpleCHOIms PurpleCHOIms commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Add an isolated HTTP-only comparison of LangChain ChatOpenAI, direct Python HTTPX, and a native Rust calling flow served by Axum/reqwest. All send the same complete Responses request and require observed provider completion, exact streamed text and model identity.

The primary cohort contains 12 direct real-model calls and 1,800 immediate response-replay calls. A separate 17,784-call paced replay ramp verifies identical one-CPU/256 MiB/zero-swap/8,192-FD budgets across 63 cells. Largest tested concurrency meeting the predeclared success ≥99%, p95 ≤3s threshold in every repeat: LangChain 64, direct Python 128, Rust 512. Rust passed the test ceiling; this is not its maximum capacity or real-provider throughput.

Changes

  • Minimal persistent streaming gateways, real captured SSE fixture, completion/error checks and six actual HTTP-rejection/truncation checks.
  • Balanced warm live calls directly to the existing Codex Responses endpoint; no common Python relay or per-request Codex process.
  • CPU, RSS/PSS, timing tails, first text, inter-chunk gaps, sockets/FDs, IO/context switches, cgroup memory/CPU/throttling/OOM and driver-capacity observations.
  • Retain individual traces, source/binary hashes, earlier complete cohorts and interrupted setup/driver diagnostics.
  • Isolated Python/Rust dependency locks; record the user's Axum preference for Rust servers.

Measured results and limitations · Reproduction · CHAGELOG.md

Intent

User-requested fair HTTP calling comparison following the separate agent-level work in #1204. No product runtime, deployment, agent feature/maturity or release change.

Blast radius

  • Tier-supply-chain — this adds test-only package manifests and lockfiles under tests/llm_http. Request normal maintainer review; do not merge automatically.
  • Production dependencies, package builds and install paths are untouched. Other changes document the same benchmark and its evidence.

Diff budget

  • Fits the runtime budget: implementation, locks and measurements are under excluded tests/**; root changes are the required changelog and the user's Axum instruction. One concern.

End-to-end verification

Executed tests/llm_http/run.py against the actual HTTPS provider and the Axum replay fixture: all 12 primary live calls report gpt-6.1-sol and 44/19/63 tokens; all 1,800 replay calls have matching outbound/upstream counts. Each gateway rejects an actual 400 and a truncated stream after one attempt. Export validation independently checks observed text/deltas/model/usage, current source and release-binary hashes, CPU affinity and warm provider TCP socket reuse.

Executed tests/llm_http/scale.py using user-systemd cgroup v2 services: 63/63 cells, 17,784/17,784 qualified stress calls, 1,976 driver-baseline calls and nine warmups. Kernel budget values, fresh service PIDs, FD limits, fixture affinity and equal upstream counts were verified. All transient services/processes were stopped. Both exporters also rejected actual interrupted evidence. Exact commands and raw archives are linked in the report.

Rust release build and release clippy -- -D warnings (both --locked with the manifest under tests/llm_http/rust) ran through /home/catow/.local/bin/with-build-slot; cargo fmt --check passed. make ci-lint passes with 0 type errors/949 reported warnings. Separate typing of all five benchmark Python files has 0 errors/0 warnings. uv run pytest tests/ -q: 37 passed, 0 skipped.

Limits

Only three warm live samples per candidate; no reliable live latency winner. Actual completion medians were 1.937s/1.641s/2.073s while CPU and RSS were lower in Rust. The concurrent ramp uses synthetic waiting with captured response content, not additional LLM calls. The shared WSL host is not a reserved physical core. Complete HTTP stacks differ, so the results do not isolate language, GIL or one pool algorithm. No multicore, long-output/backpressure, client cancellation, rate-limit recovery or memory-capacity ceiling claim. No OOM was observed.

GitHub Actions is not claimed: user-reported billing limits require local evidence. Product make quality/smoke and UI checks were not run for this isolated benchmark addition.

Testing

  • Root pytest tests/ passes.
  • Manual real HTTPS and real loopback streaming execution, with inspectable per-call evidence.
  • Required local lint/format/errors-only type gate and locked Rust release checks pass.
  • Product make quality / make smoke (not run; no production runtime change).

Quality Bar self-check

  • Reviewed implementation and complete diff; no production banned patterns or unrelated edits.
  • Python functions have explicit types; current sources/binary match the primary measurement hashes.
  • Preserves product security policy, repository protections and release/version state.
  • Reports observed evidence and its limits, including failed/interrupted discovery instead of treating it as successful performance data.

Integration review — 2026-11-17

Integrated latest main 0455ebcd while preserving all original measurement source/binary hashes and history. Reviewed every added source, report and locked dependency set. Both published summaries exactly match independent recomputation from the complete original 12 live, 1,800 replay, six rejection and 17,784 ramp request records (all 63 cells). No new live calls were required.

Fresh review execution passes 1,800 real-HTTP replay calls and six rejection/truncation checks, one attempt per call, process exit0. Used with-build-slot and the independently hash-verified unchanged release binary. Root tests: 43 passed / 0 skipped, exit0. Canonical locked make ci-lint: Ruff and format940files pass, type gate 0 errors / 964 warnings. Fixture-only typing 0 errors / 0 warnings, Cargo fmt exit0. Review timings on the shared host are functional qualification and do not replace original performance measurements; the full paced ramp was independently validated from its original archive, not rerun.

Separate public review evidence: review-20261117.json.gz, SHA256 383c53e3dad2d72d69e72cc6df9052accd3a5c9b91eb4412dff513a82c6f68f5. Updated CHAGELOG.md. No product runtime, API, version or deployment change. Hosted checks are qualified only after actual exact-head inspection.

Comment thread tests/llm_http/scale.py Resolved
@PurpleCHOIms
PurpleCHOIms merged commit 59827f6 into main Nov 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants