LEVEL 3 · ENGINEER

LLM Gateway With Fallbacks

Build a local non-streaming HTTP proxy with real provider fallback, per-provider environment credentials, response limits, and one overall deadline. Verify the complete wire path with loopback servers.

4 stages~8 hoursGocore
Validate provider endpointsClassify failures without retrying everythingSend one bounded HTTP requestRoute with a total-attempt budget
YOU END UP WITH

Build a local non-streaming HTTP proxy with real provider fallback, per-provider environment credentials, response limits, and one overall deadline. Verify the complete wire path with loopback servers.

USEFUL FOR
  • Connect an existing chat-completions client to a local fallback endpoint
  • Trace provider outages without forwarding caller credentials
PROJECT OUTLINE

LLM Gateway With Fallbacks in 4 stages

Route a bounded request through providers with explicit failure semantics.

  1. Validate provider endpoints

    Treat the provider list as trusted configuration.

    starter · ~2 hours · Go

    Parse URLTransport ruleNo credentialsStable endpoint list
  2. Classify failures without retrying everything

    Separate a repairable outage from a broken request.

    core · ~2 hours · Go

    Status bounds2xx success429 and 5xxTerminal client error
  3. Send one bounded HTTP request

    Bound one request in both bytes and time.

    core · ~2 hours · Go

    Context-bound POSTHTTP transportLimit plus oneClose response body
  4. Route with a total-attempt budget

    Route the caller body while keeping credentials private.

    core · ~2 hours · Go

    Provider orderAttempt budgetFailure classTerminal outcome

Lessons this project uses

All projects · Course catalog · Source on GitHub