ForgeCore supports multiple LLM providers, allowing you to switch between local execution (Ollama) and high-performance remote APIs (Groq, HuggingFace, OpenAI).
ForgeCore uses the backend field in config/llm_config.json to determine how to communicate with the model.
local: Uses Ollama for on-device inference.groq: Uses the Groq API for ultra-fast inference.online: Use for HuggingFace or other OpenAI-compatible inference endpoints.
The configuration is split into two roles: planner and critic. You can use different providers for each.
{
"planner": {
"backend": "groq",
"model": "qwen-2.5-coder-32b",
"temperature": 0.1,
"timeout": 60
},
"critic": {
"backend": "local",
"model": "deepseek-coder:6.7b-instruct",
"temperature": 0.1,
"timeout": 60
}
}For remote providers, you must provide an API key. ForgeCore checks two locations:
- Environment Variables (Recommended)
config/secrets.json
- Backend:
"groq" - API Key: Set
GROQ_API_KEYin your environment or inconfig/secrets.json. - Models: Groq Supported Models
- Backend:
"online" - API Key: Set
HF_API_KEYorOPENAI_API_KEYin your environment. - Models: Specify the model identifier (e.g.,
meta-llama/Llama-3.3-70B-Instruct).
- Backend:
"local"(or omit, as it is the default). - Prerequisites: Install Ollama and pull your desired models:
ollama pull qwen2.5-coder:7b-instruct ollama pull deepseek-coder:6.7b-instruct
| Feature | Local (Ollama) | Groq | Online (HF/Other) |
|---|---|---|---|
| Backend | "local" |
"groq" |
"online" |
| Model Format | name:tag |
provider-model-size |
namespace/model |
| Auth | None | GROQ_API_KEY |
HF_API_KEY |
| Speed | Hardware dependent | Ultra Fast | Moderate |
| Privacy | High (100% Local) | Moderate (Cloud) | Moderate (Cloud) |
If an online provider fails (network issue or quota exceeded), ForgeCore will automatically attempt to use a local fallback model if:
LLM_FALLBACK_LOCAL=trueis set in your environment.- You have the local equivalent installed (e.g.,
qwen2.5-coder:7b-instruct).
This logic is implemented in core/llm_client.py's _get_fallback_model function.