feat: add hummbl_model_routing package — free inference, OpenRouter, cost tracking - #36
Merged
Merged
Conversation
…cost tracking Extract model routing, free inference, and cost tracking from founder-mode as a standalone stdlib-only package. This is the canonical home for these modules; founder-mode will stub to re-export from here. Modules: - free_inference: routes chat requests to best available free LLM endpoint (Ollama, NVIDIA NIM, OpenRouter free, paid fallback). Circuit breaker per provider, retry with exponential backoff, task-class-aware model selection. - openrouter_client: OpenRouter API client (stdlib urllib, OpenAI-compatible, governed). CostGovernor for pre-call cost estimation. - cost_tracker: SQLite-backed API cost tracking with budget enforcement, health checks, HMAC auth for sensitive operations. AlertService import deferred to TYPE_CHECKING (optional dependency on founder_mode). Package: hummbl-model-routing v0.1.0 Python: >=3.11, zero third-party runtime dependencies Tests: 26 unit tests (routing, circuit breaker, cost tracker, mocked HTTP)
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
Extract model routing, free inference, and cost tracking from founder-mode as a standalone stdlib-only package. This is the canonical home for these modules; founder-mode will stub to re-export from here (PR #1969 in founder-mode).
Modules
Package
hummbl-model-routingv0.1.0[test](pytest),[governance](hummbl-governance>=1.3.0)Test plan
pip install -e .chat,TaskClass,InferenceResponse,CostTracker,BudgetStatus,UsageRecord,OpenRouterClient,CostGovernor,ChatResponse,OpenRouterNetworkError