CASE STUDY 05 / 16 · AGENTIC AISOURCE-GROUNDED IMPLEMENTATION RECORD

Asta.

My own LLM gateway: one OpenAI-compatible endpoint that routes by task, falls back when a provider runs out and tracks usage.

VIEW THE SYSTEM DESIGN
DOCUMENTED DELIVERY STAGERunning

Runs on a VPS and invokes provider models. Unlike Glyph, this is not a guarantee of local-only inference or document residency.

CORE OPERATIONAL PROBLEMEvery project needed a language model. Free tiers hit their limits, and each provider has its own API.
MY CONTRIBUTIONBuilt the FastAPI gateway, fallback routing, usage dashboard and admin-managed access on a Docker VPS.
TECHNOLOGY STACKPython / FastAPI / Docker / VPS / Android app
01 / THE CHANGE

BEFORE
& AFTER.

01 — BEFORE

The manual / previous workflow

Each app integrates separately with model providers and fails abruptly when tokens, quotas or providers run out.

02 — AFTER / TARGET

What changed

Running: one OpenAI-compatible endpoint chooses a provider by task and retries another provider after limits or failures.

IMPLEMENTATION BOUNDARY Runs on a VPS and invokes provider models. Unlike Glyph, this is not a guarantee of local-only inference or document residency.

02 / SYSTEM DESIGN

UNDER
THE HOOD.

Built from source-described project workflows. Arrows retain execution and data dependencies.

SYSTEM ARCHITECTUREAsta / PROCESS GRAPH
↓ SVG
Flow n_web->n_auth n_android->n_auth n_proj->n_auth n_auth->n_router n_router->n_p1 n_router->n_p2 on limit or error n_router->n_p3 n_p1->n_usage n_p2->n_usage n_p3->n_usage n_web Web app n_android Android app n_proj My other projects n_auth Login with admin-created accounts n_router Router picks a model by task type n_p1 First-choice provider n_p2 Fallback provider n_p3 Second fallback n_usage Usage dashboard: tokens and limits per model
PROCESS / STORE AGENT HUMAN APPROVAL NOT YET COMPLETE

Follow the workflow

STEPS / 09
  1. 01

    Web app

    Chat, model picker and document upload.

  2. 02

    Android app

    The same gateway from any network.

  3. 03

    My other projects

    They call it like any OpenAI-style API.

  4. 04

    Login with admin-created accounts

    Only accounts I create can get in.

  5. 05

    Router picks a model by task type

    Different kinds of task can go to different models.

  6. 06

    First-choice provider

    The model best suited to the task.

  7. 07

    Fallback provider

    Used when the first choice hits a limit or fails.

  8. 08

    Second fallback

    Keeps the request alive if the first two are unavailable.

  9. 09

    Usage dashboard: tokens and limits per model

    Shows what is left on each model.

03 / ENGINEERING

WHY THIS
DESIGN.

DESIGN DECISION

Technology with a specific job.

Keep the client interface stable while routing changes behind the gateway. Track usage per provider rather than treating every model as interchangeable.

TOOLS IN CONTEXT
PythonFastAPIDockerVPSAndroid app

System integrations and capabilities follow the maturity statement above; the diagram is not proof that every stage is deployed.

04 / THE EVIDENCE

IMPACT,
WITHOUT
GUESSWORK.

DOCUMENTED EVIDENCE

Running gateway, provider fallback and token dashboard; no matched cost-per-answer baseline documented.

REALIZED AED CASH SAVINGSAWAITING MEASUREMENTNo project-specific realized AED figure supplied.
THE NEXT MEASURE

Fully loaded cost per successful, quality-matched request and recovery rate after provider limits.

RECORDS NEEDED TO VERIFY

Request logs, provider bills, success/fallback rates, matched task quality scores and administrator support time.

Capacity released, avoided future expenditure and actual cash reductions are distinct. Do not allocate the portfolio-wide 20+ hours/week or 22% result to this individual case without supporting measurement.

OPEN THE AED SCENARIO CALCULATOR
05 / CONNECTED WORK

THE SYSTEM
IS CONNECTED.