Skip to content

feat: add hummbl_model_routing package — free inference, OpenRouter, cost tracking - #36

Merged
hummbl-dev merged 1 commit into
mainfrom
feat/hummbl-model-routing-package
Aug 17, 2026
Merged

feat: add hummbl_model_routing package — free inference, OpenRouter, cost tracking#36
hummbl-dev merged 1 commit into
mainfrom
feat/hummbl-model-routing-package

Conversation

@hummbl-dev

Copy link
Copy Markdown
Collaborator

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

  • 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

  • Name: hummbl-model-routing v0.1.0
  • Python: >=3.11, zero third-party runtime dependencies
  • Optional extras: [test] (pytest), [governance] (hummbl-governance>=1.3.0)

Test plan

  • 26 unit tests pass (routing order, circuit breaker, cost tracker, mocked HTTP)
  • Package installs cleanly via pip install -e .
  • All public imports work: chat, TaskClass, InferenceResponse, CostTracker, BudgetStatus, UsageRecord, OpenRouterClient, CostGovernor, ChatResponse, OpenRouterNetworkError
  • No hard dependency on founder_mode (AlertService is TYPE_CHECKING only)
  • CI green on push

…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)
@hummbl-dev
hummbl-dev merged commit 5592aee into main Aug 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant