Skip to content

feat: Add Forge as LLM provider#226

Open
Yiiii0 wants to merge 1 commit intoAlibabaResearch:mainfrom
Yiiii0:feature/forge-20260308-052919
Open

feat: Add Forge as LLM provider#226
Yiiii0 wants to merge 1 commit intoAlibabaResearch:mainfrom
Yiiii0:feature/forge-20260308-052919

Conversation

@Yiiii0
Copy link
Copy Markdown

@Yiiii0 Yiiii0 commented Mar 9, 2026

Summary

Adds a forge/ model routing branch in the obtain_chain function, following the same pattern as the existing together_ai/ and groq/ providers.

Changes

  • EPO/Sotopia/sotopia/generation_utils/generate.py: Added elif model_name.startswith("forge"): branch in obtain_chain() — strips the forge/ prefix, reads FORGE_API_KEY and FORGE_API_BASE from environment, and passes them to ChatOpenAI. Follows the exact same structure as the together_ai and groq branches.

Usage

export FORGE_API_KEY=your-forge-api-key
# Optional — defaults to https://api.forge.tensorblock.co/v1
export FORGE_API_BASE=https://api.forge.tensorblock.co/v1

Then use the forge/ prefix with any model name:

model_name = "forge/openai/gpt-4o-mini"

The forge/ prefix is stripped before sending to the API (e.g. forge/openai/gpt-4o-miniopenai/gpt-4o-mini).

I work at TensorBlock and will help maintain this integration.


About Forge

Forge is an open-source middleware that provides a unified API for 77+ AI providers (OpenAI, Anthropic, Google, DeepSeek, Together AI, Groq, etc.). It uses an OpenAI-compatible API format.

References

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 9, 2026

CLA assistant check
All committers have signed the CLA.

@Yiiii0 Yiiii0 force-pushed the feature/forge-20260308-052919 branch from d952cff to 707f280 Compare March 9, 2026 04:05
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.

2 participants