Deployment and upgradesOfficial documentation8 min readDeployment and upgrades

Integrate Qwen Local Model with FastGPT

FastGPT supports integration of custom local large language models via direct edits to its core configuration file.

Overview

FastGPT supports integration of custom local large language models via direct edits to its core configuration file. This guide outlines the exact steps to add the qwen-chat local model to your FastGPT deployment, with configuration aligned to OneAPI channel model naming standards.

Step-by-Step Configuration

  1. Locate your FastGPT config.json configuration file.
  2. Navigate to the llmModels array within the file.
  3. Insert or update the Qwen chat model entry using the following validated JSON block:
...
  "llmModels": [
    {
      "model": "qwen-chat",
      "name": "Qwen",
      "avatar": "/imgs/model/Qwen.svg",
      "maxContext": 125000,
      "maxResponse": 4000,
      "quoteMaxToken": 120000,
      "maxTemperature": 1.2,
      "charsPointsPrice": 0,
      "censor": false,
      "vision": true,
      "toolChoice": true,
      "functionCall": false,
      "customCQPrompt": "",
      "customExtractPrompt": "",
      "defaultSystemChatPrompt": "",
      "defaultConfig": {}
    }
  ],
...

Note: The model field must exactly match the channel model name configured in your connected OneAPI instance.

Configuration Parameter Reference

All supported parameters for the custom LLM entry are defined below, using exact values from the example:

ParameterData TypeDescriptionExample Value
modelstringExact match to OneAPI channel model nameqwen-chat
namestringDisplay name for the model in FastGPT UIQwen
avatarstringRelative path to the model's logo asset/imgs/model/Qwen.svg
maxContextintegerMaximum total context token limit for conversations125000
maxResponseintegerMaximum allowed response token length per request4000
quoteMaxTokenintegerMaximum token limit for cited content120000
maxTemperaturefloatUpper bound for the temperature parameter1.2
charsPointsPriceintegerPoints per 1k tokens (Commercial Edition only)0
censorbooleanToggle built-in content moderationfalse
visionbooleanEnable support for image inputtrue
toolChoicebooleanSupport explicit tool calling workflowstrue
functionCallbooleanFallback function calling support (overridden by toolChoice)false
customCQPromptstringCustom classification prompt for non-tool-call models""
customExtractPromptstringCustom content extraction prompt""
defaultSystemChatPromptstringDefault system prompt for all chat conversations""
defaultConfigobjectDefault parameters sent with every API request{}

Activate the Configured Model

After saving your modified config.json file, restart your FastGPT service to apply the new configuration. Once the service is back online, navigate to the FastGPT application configuration panel, where you can now select the Qwen model from the list of available large language models.

Source: FastGPT official source

Applicability and version scope

Use this page for the documented Deployment and upgrades 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.