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”- 1core pipelineModules
crates/proxai-core/src/pipeline/src/pipeline/ResponsibilityCompose structured ingress, routing, translation, and provider adaptation in core while the app owns HTTP carriers and transport.
- 2ingressModules
src/pipeline/inbound.rscrates/proxai-core/src/ingress/ResponsibilityDetect inbound protocol and parse HTTP bytes in the application adapter, then normalize and validate structured payloads in core.
- 3routingModules
src/config.rscrates/proxai-core/src/pipeline/ResponsibilitySelect provider by protocol-aware defaults or explicit model routes.
- 4translationModules
crates/proxai-core/src/translation/ResponsibilityConvert protocol payloads and streams without HTTP carriers; legal adaptations emit typed observations.
- 5providerModules
crates/proxai-core/src/provider/src/provider/*/requestsrc/provider/*/transportResponsibilityPrepare structured provider values in core, then project, serialize, authenticate, and send them in the application.
- 6response 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/pipeline/inbound.rsInbound HTTP path/protocol detection, JSON byte parsing, and application error mapping.
crates/proxai-core/src/pipeline/Carrier-independent request/response composition façade and request-scoped core observer binding.
crates/proxai-core/src/ingress/Carrier-independent request normalization, protocol validation, model extraction, and typed ingress observations.
crates/proxai-core/src/observe.rsShared `Observer` contract, closed `Observation` variants, and no-op default.
crates/proxai-core/src/protocol/Wire data models for OpenAI Responses, OpenAI Chat Completions, Anthropic Messages, and SSE payloads.
crates/proxai-core/src/translation/Carrier-independent protocol-to-protocol payload and stream conversion across explicit pairs, with typed adaptation observations.
crates/proxai-core/src/provider/Carrier-independent provider request value preparation, structured response/error normalization, and typed adaptation observations.
src/provider/*/requestProvider logging projection/summary extraction, outbound payload serialization, and request carrier assembly.
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.