Model guidesOfficial documentation7 min readModel guides

Add a New Model Provider to FastGPT

This guide covers the formal steps to add a custom model provider to FastGPT.

This guide covers the formal steps to add a custom model provider to FastGPT.

Create Provider Directory

Create a dedicated directory under packages/infrastructure/src/static-data/models/provider/ using your provider’s unique identifier. The required directory structure is:

packages/infrastructure/src/static-data/models/provider/NewProvider/
├── index.ts
└── logo.svg

The logo.svg file acts as the model provider’s avatar. During plugin service initialization, the static model asset pipeline uploads the file from provider/{Provider}/logo.svg to the path models/{Provider}/logo. The /models/get-providers API returns this asset URL as the provider’s avatar field.

Configure Provider Model File

The index.ts file defines the provider’s supported models. The base structure uses required imports and model configuration:

import { ModelTypeEnum, type ProviderConfigType } from '../../type';

const models: ProviderConfigType = {
  provider: 'NewProvider',
  list: [
    {
      type: ModelTypeEnum.llm,
      model: 'new-provider-chat',
      maxContext: 128000,
      maxTokens: 8192,
      quoteMaxToken: 120000,
      maxTemperature: 1,
      responseFormatList: ['text'],
      vision: false,
      reasoning: false,
      reasoningEffort: false,
      toolChoice: true
    }
  ]
};

export default models;

Model Configuration Parameters

All supported parameters for each model entry are defined explicitly in the configuration:

ParameterTypeStandard Template Value
providerstringUnique provider identifier matching the directory name
typeModelTypeEnumllm for large language model use cases
modelstringUnique model identifier for the provider
maxContextnumberMaximum total context window size
maxTokensnumberMaximum output token limit per request
quoteMaxTokennumberMaximum token count for quoted content
maxTemperaturenumberMaximum allowed temperature value, capped at 1
responseFormatListstring[]Supported response formats, set to ['text']
visionbooleanWhether the model supports visual input, set to false
reasoningbooleanWhether the model supports native reasoning, set to false
reasoningEffortbooleanWhether the model supports reasoning effort configuration, set to false
toolChoicebooleanWhether the model supports tool calling, set to true

Source: FastGPT official source

Applicability and version scope

Use this page for the documented Model guides scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.

Safety guardrails

Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.

Rollback guidance

Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.