X Tutup
Skip to content

feat: Add Forge as LLM provider#173

Open
Yiiii0 wants to merge 1 commit intoszczyglis-dev:masterfrom
Yiiii0:feature/forge-20260308-061215
Open

feat: Add Forge as LLM provider#173
Yiiii0 wants to merge 1 commit intoszczyglis-dev:masterfrom
Yiiii0:feature/forge-20260308-061215

Conversation

@Yiiii0
Copy link

@Yiiii0 Yiiii0 commented Mar 9, 2026

Summary

Adds Forge as a new LLM provider in py-gpt. Implements ForgeLLM class extending BaseLLM with llama-index integration, embeddings support, and model listing via Forge's OpenAI-compatible API.

Changes

  • src/pygpt_net/provider/llms/forge.py: New ForgeLLM class with llama-index LLM, embeddings, and model listing
  • src/pygpt_net/app.py: Register ForgeLLM provider in launcher
  • src/pygpt_net/core/models/models.py: Add forge branch in prepare_client_args for API key and endpoint resolution
  • src/pygpt_net/core/types/openai.py: Add "forge" to OPENAI_COMPATIBLE_PROVIDERS
  • src/pygpt_net/data/config/config.json: Add api_endpoint_forge and api_key_forge config entries
  • src/pygpt_net/data/config/settings.json: Add Forge API key and endpoint settings UI fields

Usage

  1. Go to Settings > API Keys > Forge tab
  2. Enter your Forge API key (or set FORGE_API_KEY environment variable)
  3. Select a Forge model from the model list

Test Evidence

All existing tests pass. The integration follows the same BaseLLM + OpenAILike pattern used by OpenRouter.

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:
src/pygpt_net/app.py
src/pygpt_net/core/models/models.py
src/pygpt_net/core/types/openai.py
src/pygpt_net/data/config/config.json
src/pygpt_net/data/config/settings.json
src/pygpt_net/provider/llms/forge.py
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

X Tutup