Wiki source code of LLM Abstraction Architecture Mermaid
Last modified by Robert Schaub on 2025/12/24 20:16
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{mermaid}} |
| 2 | graph LR | ||
| 3 | subgraph AKEL["AKEL Pipeline"] | ||
| 4 | S1[Stage 1<br/>Extract Claims] | ||
| 5 | S2[Stage 2<br/>Analyze Claims] | ||
| 6 | S3[Stage 3<br/>Holistic Assessment] | ||
| 7 | end | ||
| 8 | |||
| 9 | subgraph LLM["LLM Abstraction Layer"] | ||
| 10 | INT[Provider Interface] | ||
| 11 | CFG[Configuration<br/>Registry] | ||
| 12 | FAIL[Failover<br/>Handler] | ||
| 13 | end | ||
| 14 | |||
| 15 | subgraph Providers["LLM Providers"] | ||
| 16 | ANT[Anthropic<br/>Claude API<br/>PRIMARY] | ||
| 17 | OAI[OpenAI<br/>GPT API<br/>SECONDARY] | ||
| 18 | GOO[Google<br/>Gemini API<br/>TERTIARY] | ||
| 19 | LOC[Local Models<br/>Llama/Mistral<br/>FUTURE] | ||
| 20 | end | ||
| 21 | |||
| 22 | S1 --> INT | ||
| 23 | S2 --> INT | ||
| 24 | S3 --> INT | ||
| 25 | |||
| 26 | INT --> CFG | ||
| 27 | INT --> FAIL | ||
| 28 | |||
| 29 | CFG --> ANT | ||
| 30 | FAIL --> ANT | ||
| 31 | FAIL --> OAI | ||
| 32 | FAIL --> GOO | ||
| 33 | |||
| 34 | ANT -.fallback.-> OAI | ||
| 35 | OAI -.fallback.-> GOO | ||
| 36 | |||
| 37 | style AKEL fill:#ffcccc | ||
| 38 | style LLM fill:#ccffcc | ||
| 39 | style Providers fill:#e1f5ff | ||
| 40 | style ANT fill:#ff9999 | ||
| 41 | style OAI fill:#99ccff | ||
| 42 | style GOO fill:#99ff99 | ||
| 43 | style LOC fill:#cccccc | ||
| 44 | {{/mermaid}} | ||
| 45 | |||
| |
2.1 | 46 | **LLM Abstraction Architecture** - AKEL stages call through provider interface. Configuration registry selects provider per stage. Failover handler implements automatic fallback chain. |
| 47 | |||
| 48 | **POC1 Implementation:** | ||
| 49 | * PRIMARY: Anthropic Claude API (Haiku 4.5 for Stage 1, Sonnet 4.5 for Stages 2 & 3) | ||
| 50 | * Failover: Basic error handling with cache fallback | ||
| 51 | |||
| 52 | **Future (POC2/Beta):** | ||
| 53 | * SECONDARY: OpenAI GPT API (automatic failover) | ||
| 54 | * TERTIARY: Google Gemini API (tertiary fallback) | ||
| 55 | * FUTURE: Local models (Llama/Mistral for on-premises deployments) | ||
| 56 | |||
| 57 | **Architecture Benefits:** | ||
| 58 | * Prevents vendor lock-in | ||
| 59 | * Ensures resilience through automatic failover | ||
| 60 | * Enables cost optimization per stage | ||
| 61 | * Supports regulatory compliance (provider selection for data residency) | ||
| 62 |