Eridian
ARCHITECTURE

Why Your LLM Inference Pipeline Is Broken (And How to Fix It)

James Okafor · · 15 min read

Why Your LLM Inference Pipeline Is Broken (And How to Fix It)

Most teams treat LLM inference as a thin wrapper around an OpenAI or Anthropic API call. Prompt in, response out. Ship it. This works until you have 14 teams, 6 model providers, no cost attribution, no audit trail, and a CISO asking why client data is leaving your VPC.

The Pipeline Is the Product

Eridian's architecture treats inference as a pipeline: schema normalization → routing → semantic cache → RAG → PII redaction → model inference → structured output parsing → observability. The model is an implementation detail. The pipeline is what your compliance team audits.

response = client.inference(
    model="auto",
    messages=[{"role": "user", "content": prompt}],
    project_id="prj_legal_001",
    features=["pii_redaction", "semantic_cache", "structured_output"],
)

print(response.eridian.route)       # claude-sonnet-5
print(response.eridian.cache_hit)   # True
print(response.eridian.pii_redacted) # 2
print(response.eridian.cost_usd)    # 0.0042

Three Failure Modes We See Repeatedly

  • No observability: Teams can't answer 'which team spent $40K last Tuesday?'
  • No governance: Every team picks their own model, their own API key, their own data handling.
  • No resilience: Single-model dependency means one provider outage takes down every workflow.

Fixing this doesn't require rebuilding your applications. Eridian is OpenAI-compatible and Anthropic-compatible. Point your SDK at our gateway. The pipeline runs transparently. Your app code changes minimally; your infrastructure changes completely.

Calling a model API directly gives you tokens. Calling Eridian gives you an attributable, governable unit of work. That distinction matters when legal asks for provenance and finance asks for cost allocation by team, feature, and workflow.

Schema normalization means your client can speak OpenAI-style messages while the routing layer translates to provider-native formats. Your integration code stays stable when providers revise parameter names or response envelopes.

Pipeline stages emit spans compatible with OpenTelemetry. Each span includes project_id, key_id, template version, and feature flags active for the request.

Failure isolation is per stage. A RAG retrieval timeout does not silently disable PII redaction; the request fails explicitly with error.code rag_timeout unless degraded_mode is configured - off by default for regulated tenants.

Batch and streaming paths share governance hooks. Streaming still records final token counts, cost, and route selection when the client closes the SSE connection.

Migration from direct OpenAI or Anthropic usage typically requires changing base URL and API key, then enabling features incrementally: observability first, caching second, PII third, routing fourth.

Multi-step workflows should pass consistent metadata across calls so audit exports correlate sub-steps. Use workflow_run_id in metadata for agentic graphs.

Capacity planning must include embedding throughput when semantic caching is enabled. Eridian scales embedding workers independently from model gateway workers.

Gateway workers authenticate keys before any pipeline stage executes, preventing unauthenticated traffic from touching embedding or retrieval subsystems.

Structured output retries append corrective system messages; each retry is billed and logged separately for cost transparency.

Webhook emissions fire after pipeline completion, not after model response alone, so downstream systems see final eridian metadata.

Rate limits apply at key and project granularity simultaneously; breaching either returns 429.

Shadow traffic for migration validation duplicates requests to Eridian while production still hits legacy providers until cutover checklist completes.

Disaster recovery scenarios assume provider outage plus cache unavailability. Fallback chains and queue shedding policies are tested quarterly for enterprise contracts.

The pipeline is the product. Models are replaceable components inside it.

Calling a model API directly gives you tokens. Calling Eridian gives you an attributable, governable unit of work. That distinction matters when legal asks for provenance and finance asks for cost allocation by team, feature, and workflow.

Schema normalization means your client can speak OpenAI-style messages while the routing layer translates to provider-native formats. Your integration code stays stable when providers revise parameter names or response envelopes.

Pipeline stages emit spans compatible with OpenTelemetry. Each span includes project_id, key_id, template version, and feature flags active for the request.

Failure isolation is per stage. A RAG retrieval timeout does not silently disable PII redaction; the request fails explicitly with error.code rag_timeout unless degraded_mode is configured - off by default for regulated tenants.

Batch and streaming paths share governance hooks. Streaming still records final token counts, cost, and route selection when the client closes the SSE connection.

Migration from direct OpenAI or Anthropic usage typically requires changing base URL and API key, then enabling features incrementally: observability first, caching second, PII third, routing fourth.

Multi-step workflows should pass consistent metadata across calls so audit exports correlate sub-steps. Use workflow_run_id in metadata for agentic graphs.

Capacity planning must include embedding throughput when semantic caching is enabled. Eridian scales embedding workers independently from model gateway workers.

Gateway workers authenticate keys before any pipeline stage executes, preventing unauthenticated traffic from touching embedding or retrieval subsystems.

Structured output retries append corrective system messages; each retry is billed and logged separately for cost transparency.

Webhook emissions fire after pipeline completion, not after model response alone, so downstream systems see final eridian metadata.

Rate limits apply at key and project granularity simultaneously; breaching either returns 429.

Shadow traffic for migration validation duplicates requests to Eridian while production still hits legacy providers until cutover checklist completes.

Disaster recovery scenarios assume provider outage plus cache unavailability. Fallback chains and queue shedding policies are tested quarterly for enterprise contracts.

The pipeline is the product. Models are replaceable components inside it.

Document each pipeline stage owner in enterprise runbooks: gateway, retrieval, redaction, routing, observability.

Run game days simulating provider 503 storms to validate fallback chains under realistic concurrency.

Require metadata.workflow_id on all production keys used by automated jobs for audit completeness.

Compare shadow and live eridian metadata weekly during migrations until error rates match within agreed bounds.

Instrument client SDK retries separately from server-side fallback to avoid duplicate billing surprises.

Publish breaking change notices for eridian object fields with 90-day deprecation windows minimum.

Validate streaming clients handle terminal events carrying final cost and token counts, not just text deltas.

Schedule quarterly access reviews for keys with inference:write and keys:manage scopes together.

Map each business workflow to explicit feature flags rather than enabling all features globally by default.

Educate finance partners on difference between tokens processed and successful business outcomes.

Add pipeline stage latency budgets to service maps used by on-call engineers.

Review feature flag defaults during enterprise onboarding workshops with customer architects.

Capture exemplar requests per workflow for onboarding new SRE rotations quickly.

Validate webhook signatures in staging before enabling production incident automations.

Run monthly drills promoting secondary regions when primary region latency degrades.

Document provider-specific error code mappings in internal wiki linked from runbooks.

Align pipeline observability dashboards with executive KPI definitions to avoid metric debates.

Track adoption of structured output separately from raw inference volume as maturity indicator.

Publish internal compatibility matrix when SDK major versions bump gateway features.

Enterprise architects map each pipeline stage to existing monitoring tools already approved by IT.

SREs define SLO burn policies on eridian.latency_ms stratified by feature flag combinations.

Compliance stores sample eridian metadata JSON blobs as evidence artifacts for annual audits.

Platform teams maintain migration runbooks from Bedrock, OpenAI, and Anthropic direct usage with checklists.

Support enables request_id lookup self-service for customers with observability:read scope only.

Pipeline canaries run synthetic requests after every gateway deploy before traffic shift.

Internal status dashboards segment incidents by pipeline stage for targeted comms.

SDK release notes cross-link to eridian metadata fields added in each version.

Enterprise tenants request dedicated pipeline isolation; architecture docs describe cell boundaries.

Throughput tests validate RAG and cache stages independently from model gateway saturation points.

Operations maintains runbooks for disabling features globally during upstream provider CVE responses.

Developer relations publishes migration cookbooks with side-by-side request/response diffs.

Audit sampling verifies metadata.workflow_id presence on automated job keys above threshold volume.

Training labs walk engineers through interpreting eridian headers in browser devtools via proxy.

Reliability reviews treat missing eridian.request_id in client logs as integration defect severity two.

Feature adoption metrics guide technical account managers during quarterly business reviews.

Pipeline configuration snapshots export with infrastructure-as-code pipelines for disaster recovery.

Operations correlates provider maintenance windows with preemptive fallback policy activation.

Internal hack weeks prototype new pipeline stages behind feature flags with explicit kill switches.

Customer engineering maintains a library of exemplar eridian metadata payloads for training new hires across time zones.

Gateway rate limiters coordinate with upstream provider quotas using token buckets refreshed every minute with burst allowances documented per contract tier.

Platform reliability engineers treat missing structured output validation on financial reporting workflows as launch-blocking defects during pre-production checklists.

Eridian metadata fields are versioned; clients should ignore unknown fields forward-compatibly per documented SDK guidance updated each release.

Observability exports include OpenTelemetry baggage propagation examples for customers standardizing on W3C trace context headers across microservices.

Batch inference jobs should include idempotency keys when retry logic at the orchestrator layer could otherwise duplicate side effects downstream.

Gateway deploys use progressive traffic shifts with automated rollback when error rate or p99 latency exceeds canary thresholds for fifteen minutes.

Internal training emphasizes difference between provider outages and pipeline misconfiguration using exemplar traces from past incidents sanitized for learning.

Customers document feature flag matrices mapping business workflows to enabled pipeline stages before production keys are issued broadly to development teams.

Support categorizes tickets by pipeline stage using eridian metadata to route experts faster during high-severity incidents affecting multiple tenants.

James Okafor

VP of Engineering

James Okafor is Vice President of Engineering at Eridian. He holds the production path of the operating system, from model access to signed record. Routing, evaluation, residency, and the controls that keep institutional workloads inside policy sit under his function. His work is to keep Eridian reliable, reviewable, and fit for regulated use at institutional scale.

Related Posts