Developer Guide
Developer Guide
Section titled “Developer Guide”This section is for maintainers changing ProxAI internals. It focuses on source-level boundaries, protocol conversion rules, streaming behavior, and error projection.
Core boundaries
Section titled “Core boundaries”- 1ingressModules
src/ingress/src/protocol/ResponsibilityDetect inbound protocol, parse payloads, and normalize inbound request shape.
- 2routingModules
src/config.rspipeline routingResponsibilitySelect provider by protocol-aware defaults or explicit model routes.
- 3translationModules
src/translation/ResponsibilityConvert protocol payloads and streams across pure protocol boundaries.
- 4providerModules
src/provider/*/requestsrc/provider/*/transportResponsibilityPrepare provider request payloads, rewrite models, add provider auth, construct upstream URLs, and send.
- 5response reconstructionModules
src/http_supportsrc/error/ResponsibilityTranslate responses back to the inbound protocol and render compact client-facing errors.
Source tree map
Section titled “Source tree map”src/ingress/Inbound HTTP path/protocol detection, request parsing, and normalization before routing.
src/protocol/Wire data models for OpenAI Responses, OpenAI Chat Completions, Anthropic Messages, and SSE payloads.
src/translation/Pure protocol-to-protocol payload and stream conversion across explicit pairs.
src/provider/*/requestProvider request preparation, projection, provider model rewrite, and outbound payload serialization.
src/provider/*/transportUpstream URL construction, provider authentication headers, and HTTP send behavior.
src/provider/*/responseProvider response summaries, streaming observers, protocol state machines, and outcome diagnostics.
src/http_support/HTTP carrier helpers for response header/body reconstruction and byte streams.
src/error/Typed internal errors and compact client-facing HTTP/SSE error rendering.
src/observe/Structured logs, request hints, duration coloring, and capture-safe diagnostics.
Change map
Section titled “Change map”New runtime settingUpdate src/config.rs, config.example.toml, user docs, reference docs, and tests for generated defaults.
Where to change codeUse the task-oriented source map before touching routing, provider, translation, streaming, error, capture, or docs internals.
Test mapChoose the narrowest validation command first, then expand for user-visible proxy or streaming behavior.
New conversion pairAdd request/response/streaming conversion, route support, behavior tests, and protocol docs.
Streaming changeCheck carrier semantics, SSE terminal events, tool-call stalls, Unicode chunk scanning, and e2e tests.
Error rendering changeUpdate error projection, preserved headers, SSE error behavior, and behavior contracts.