CBOR (Concise Binary Object Representation) wire capture provides a high-performance, compact alternative to JSON-based wire capture. It records full HTTP requests and responses in a binary format that is faster to write and takes up less space.
CBOR wire capture is designed for high-throughput environments where minimizing I/O overhead is critical. It captures the same detailed information as the JSON format but uses the efficient CBOR binary standard.
You can enable CBOR capture via the CLI or configuration file.
python -m src.core.cli --cbor-capture-file var/wire_captures_cbor/session.cborlogging:
cbor_capture_file: "var/wire_captures_cbor/session.cbor"Since CBOR is a binary format, you cannot read it directly with a text editor. The project provides a dedicated inspection tool: scripts/inspect_cbor_capture.py.
python scripts/inspect_cbor_capture.py var/wire_captures_cbor/session.cborThis will print a summary of the capture file, including session ID, duration, and entry counts.
You can filter entries to find specific requests or time ranges.
Filter entries based on timestamps. You can use Unix timestamps, ISO datetime strings, or time-only strings (assumes today's date).
# Filter by Unix timestamp
python scripts/inspect_cbor_capture.py session.cbor --start-time 1702300000 --end-time 1702400000
# Filter by ISO datetime
python scripts/inspect_cbor_capture.py session.cbor --start-time "2024-01-15T10:00:00"
# Filter by time of day
python scripts/inspect_cbor_capture.py session.cbor --start-time "10:30:00" --end-time "11:00:00"# Show only entries for the OpenAI backend
python scripts/inspect_cbor_capture.py session.cbor --backend openai# Show only backend responses
python scripts/inspect_cbor_capture.py session.cbor --direction backend_to_proxyThe tool includes powerful analysis features to help debug issues.
Automatically scan for common problems like errors, slow responses, or rate limits.
python scripts/inspect_cbor_capture.py session.cbor --detect-issuesAnalyze paired requests and responses to see latency, token usage, and content.
python scripts/inspect_cbor_capture.py session.cbor --analyzeVisualize traffic over time to identify gaps or latency spikes.
python scripts/inspect_cbor_capture.py session.cbor --timelineIf you need to process the data with other tools (like jq), you can export it to JSON.
python scripts/inspect_cbor_capture.py session.cbor --json > export.json