feat: make ContentForge provider-agnostic (any OpenAI-compatible LLM)#2
Merged
Conversation
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.
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.
What
Makes ContentForge provider-agnostic — it now runs on any OpenAI-compatible
/chat/completionsendpoint 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 genericLLMConfigwithPROVIDER_PRESETS(openai/openrouter/ollama/mimo), bearer vs api-key auth styles, env-var resolution.MiMoConfigkept as a backward-compat subclass;ContentForgeConfig.mimoaliases.llmand legacymimo:YAML blocks still load.core/llm_client.py—LLMClient(renamed fromMiMoClient, now provider-agnostic).core/mimo_client.pyis a thin re-export shim;MiMoClientremains an importable alias..github/workflows/ci.yml: ruff lint + format check + pytest with coverage on Python 3.10/3.11/3.12.CONTRIBUTING.mdand issue templates.ruff formatrepo-wide, removed dead locals.Backward compatibility
No breaking changes. Existing
MIMO_API_KEY/MiMoConfig/MiMoClient/mimo:config usage all continue to work.Verification