feat(llm): LLM Provider Abstraction Layer (Issue #99 - $600 Bounty)#608
Open
sirius-016 wants to merge 11 commits into
Open
feat(llm): LLM Provider Abstraction Layer (Issue #99 - $600 Bounty)#608sirius-016 wants to merge 11 commits into
sirius-016 wants to merge 11 commits into
Conversation
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a complete LLM Provider Abstraction Layer as described in Issue #99.
What's included
Core Modules (7 new files + 1 modified)
Lux.LLM.Provider— New behaviour withmetadata/0andhealth_check/0callbacks, model info helpersLux.LLM.Registry— ETS-backed provider registry (GenServer for writes, ETS for reads)Lux.LLM.Router— Intelligent routing with 5 strategies::cost,:latency,:quality,:round_robin,:fallbackLux.LLM.Fallback— Circuit breaker (closed/open/half_open states) + exponential backoff retryLux.LLM.Monitoring— Per-provider & per-model cost/latency tracking with ETS aggregationLux.LLM.Cache— ETS LRU cache with TTL, hit/miss statisticsLux.LLM.Manager— High-levelchat/3API that orchestrates routing + fallback + caching + monitoringLux.LLM— Updated withchat/3,configure/1,usage_report/0,total_cost/0,cache_stats/0Tests (7 files)
Documentation
guides/llm_abstraction.livemd)benchmarks/llm_benchmark.exs)Acceptance Criteria
Lux.LLM.Providerbehaviour)Lux.LLM.Registry)Lux.LLM.Routerwith cost/latency/quality strategies)Lux.LLM.Monitoringwith per-token pricing)Total: 17 files, ~50KB
Closes #99