Skip to content

feat: make ContentForge provider-agnostic (any OpenAI-compatible LLM)#2

Merged
aimanmalib merged 6 commits into
mainfrom
feat/provider-agnostic-llm
Jun 5, 2026
Merged

feat: make ContentForge provider-agnostic (any OpenAI-compatible LLM)#2
aimanmalib merged 6 commits into
mainfrom
feat/provider-agnostic-llm

Conversation

@aimanmalib

Copy link
Copy Markdown
Owner

What

Makes ContentForge provider-agnostic — it now runs on any OpenAI-compatible /chat/completions endpoint instead of being locked to one backend.

Why

The pipeline already spoke the standard OpenAI protocol internally; only the config/client names and auth header were hardcoded. This change exposes that flexibility so users can run on OpenAI, OpenRouter, Ollama, llama.cpp, or Xiaomi MiMo with a single config line.

Changes

  • core/config.py — new generic LLMConfig with PROVIDER_PRESETS (openai/openrouter/ollama/mimo), bearer vs api-key auth styles, env-var resolution. MiMoConfig kept as a backward-compat subclass; ContentForgeConfig.mimo aliases .llm and legacy mimo: YAML blocks still load.
  • core/llm_client.pyLLMClient (renamed from MiMoClient, now provider-agnostic). core/mimo_client.py is a thin re-export shim; MiMoClient remains an importable alias.
  • Tests — +16 tests covering presets, auth styles, env resolution, and backward-compat paths. 112 tests pass (was 96).
  • CI — new .github/workflows/ci.yml: ruff lint + format check + pytest with coverage on Python 3.10/3.11/3.12.
  • Docs — README rebranded with a Supported Providers table; added CONTRIBUTING.md and issue templates.
  • Cleanup — applied ruff format repo-wide, removed dead locals.

Backward compatibility

No breaking changes. Existing MIMO_API_KEY / MiMoConfig / MiMoClient / mimo: config usage all continue to work.

Verification

ruff check src/ tests/      # All checks passed!
ruff format --check          # 31 files already formatted
pytest                       # 112 passed

Introduce generic LLMConfig + LLMClient supporting any OpenAI-compatible
endpoint (OpenAI, OpenRouter, Ollama, MiMo, llama.cpp) with bearer or
api-key auth. MiMoConfig/MiMoClient kept as backward-compat aliases.
All 96 existing tests still pass.
Cover provider presets (openai/openrouter/ollama/mimo), bearer vs
api-key auth, env-var resolution, and MiMo backward-compat paths.
Remove unused locals in 'agents' CLI command. Ruff clean, 112 tests pass.
Reposition from 'MiMo-exclusive' to 'any OpenAI-compatible LLM'.
Add Supported Providers table (OpenAI/OpenRouter/Ollama/MiMo),
update config examples to llm: block with provider field, switch
API reference to LLMClient. MiMo now listed as one provider among many.
Add .github/workflows/ci.yml (ruff lint + format check + pytest with
coverage across Python 3.10/3.11/3.12). Apply ruff format across the
codebase so the format gate passes. 112 tests green.
Add contributor guide (dev setup, local gate, how to add a provider
preset, good first issues) plus GitHub issue templates for bug reports
and feature requests with a template chooser config.
Update pyproject description/keywords, package docstring, CLI help text,
and HTML export footer to reflect provider-agnostic positioning.
Ruff clean, format clean, 112 tests pass.
@aimanmalib aimanmalib merged commit 5bf095e into main Jun 5, 2026
3 checks passed
@aimanmalib aimanmalib deleted the feat/provider-agnostic-llm branch June 5, 2026 07:32
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