Skip to content

feat: Add Forge as LLM provider#37

Open
Yiiii0 wants to merge 1 commit intolupantech:mainfrom
Yiiii0:feature/forge-20260308-053347
Open

feat: Add Forge as LLM provider#37
Yiiii0 wants to merge 1 commit intolupantech:mainfrom
Yiiii0:feature/forge-20260308-053347

Conversation

@Yiiii0
Copy link

@Yiiii0 Yiiii0 commented Mar 9, 2026

Summary

Adds Forge as a new LLM provider in AgentFlow. Uses the forge- model prefix (matching the existing together-, vllm-, ollama- conventions) to route requests through Forge's OpenAI-compatible API.

Changes

  • agentflow/.env.template: Added FORGE_API_KEY and FORGE_API_BASE environment variables
  • agentflow/agentflow/engine/factory.py: Added forge- prefix detection to route through ChatOpenAI with Forge credentials
  • agentflow/agentflow/engine/openai.py: Added optional api_key and base_url parameters to ChatOpenAI.__init__
  • assets/doc/api_key.md: Documented Forge API key setup
  • assets/doc/llm_engine.md: Added Forge to the LLM engine table

Usage

# Set environment variable
export FORGE_API_KEY="your-forge-api-key"

# Use forge- prefix with Provider/model-name format
python run.py --model "forge-OpenAI/gpt-4o-mini" ...

Test Evidence

All existing tests pass. The change is additive — when not using the forge- prefix, behavior is identical to upstream.

I work at TensorBlock and will help maintain this integration.


About Forge

Forge is an open-source middleware service for unified AI model provider management. It routes requests across 40+ AI providers with access to thousands of models through a single OpenAI-compatible API.

## Changes

- Automated integration updates from manager loop.

Files modified:
agentflow/.env.template
agentflow/agentflow/engine/factory.py
agentflow/agentflow/engine/openai.py
assets/doc/api_key.md
assets/doc/llm_engine.md
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