One application.
Many AI providers.
AIRTP is a transport abstraction layer that separates application logic from AI providers. Applications communicate with a consistent session layer while provider adapters translate requests into provider-specific protocols. Swapping providers becomes a configuration decision rather than a rewrite.
Start with the TL;DRTL;DR
Provider Independence
Application code targets AIRTP rather than a vendor SDK. Adapters map AIRTP semantics onto each provider.
Transport Independence
HTTP, WebSocket, local processes, pipes, or future transports all fit behind a consistent session interface.
Protocol Features
Capability negotiation, message envelopes, streaming, chunking, and reassembly are protocol concepts instead of provider-specific code.
Core ideas
Interactive Layered Architecture
Each layer has a single responsibility. Select a layer in the diagram to highlight its role and observe how AIRTP isolates application logic from provider-specific implementations.
- Application — business logic and prompts.
- Session Layer — lifecycle, routing, state.
- Provider Adapter — translates AIRTP into provider APIs.
- Transport — HTTP, WebSocket, IPC, or future transports.
- AI Provider — executes inference.
Protocol Flow Animation
AIRTP represents communication as structured protocol messages rather than direct provider SDK calls. Requests travel downward through the stack and streamed responses travel back upward using the same session.
Open Session
Negotiate Capabilities
Send Envelope
Receive Stream
Complete Session
Provider Independence
AIRTP applications target a stable protocol instead of a vendor SDK. Provider-specific differences are isolated inside adapters, allowing applications to switch providers without changing business logic.
| Concern | Application | Adapter |
|---|---|---|
| Authentication | None | Provider-specific |
| Request Format | AIRTP Envelope | Translation |
| Streaming | Session Events | Protocol Mapping |
| Error Handling | Unified | Normalization |
| Model Selection | Logical Capability | Provider Mapping |
Adding a new provider requires implementing an adapter rather than modifying application code.
Transport Independence
The AIRTP protocol is independent of the underlying transport. Reliable message delivery, streaming, and session semantics remain consistent regardless of how bytes move between peers.
Capability Negotiation
Capabilities are exchanged during session establishment. Applications express requirements while adapters advertise supported features. The result is a negotiated feature set shared by both endpoints.
| Capability | Status |
|---|---|
| Streaming | Enabled |
| Structured Output | Enabled |
| Tool Calling | Enabled |
| Audio | Unavailable |
| Vision | Optional |
Client
│
├── supported_features[]
│
▼
Session Layer
│
├── intersect()
│
▼
Provider Adapter
│
├── provider_capabilities[]
│
▼
Negotiated Session
Negotiation allows AIRTP to expose the strongest common feature set without requiring application changes for each provider.
Message Envelope Visualization
Every AIRTP exchange is represented as a structured message envelope. Metadata remains separate from payload data, allowing adapters to translate protocol semantics without altering application intent.
Chunking & Reassembly
Large payloads and streaming responses are transmitted as ordered chunks. The session layer tracks sequence numbers, detects completion, and reassembles messages before presenting them to the application.
Why chunk?
- Supports arbitrarily large responses.
- Allows progressive streaming to the application.
- Improves resilience across diverse transports.
- Provides deterministic ordering using sequence numbers.
- Enables resumable session semantics.