Model guidesOfficial documentation6 min readModel guides

Validate Updated FastGPT Model Preset Changes

Model preset modifications in FastGPT can introduce unintended issues if not properly validated.

Model preset modifications in FastGPT can introduce unintended issues if not properly validated. This document outlines the official, source-verified validation workflow to ensure your changes are correct, compliant, and do not break existing functionality. All steps are taken directly from the FastGPT official model presets documentation.

Mandatory Basic Validation

After making any changes to FastGPT model presets, run the following mandatory command to validate type safety across the codebase. This checks for type mismatches, missing fields, and other syntax-related errors specific to your preset updates:

pnpm typecheck

Running this command first catches simple, common errors before proceeding to more comprehensive testing.

Extended Comprehensive Validation

For changes that impact broad areas of the model preset system—including modifications to multiple AI providers, model schemas, or static asset loading logic—you must run the full test suite to validate end-to-end functionality:

pnpm test

This test suite covers integration with provider APIs, schema validation for model configurations, and static asset loading, ensuring that your changes do not disrupt existing working components of the FastGPT platform.

Static Data Diff Review

The final mandatory pre-submission step is reviewing the git diff for the static model data directory located at packages/infrastructure/src/static-data/models/. Use this structured checklist to validate the diff thoroughly:

Validation TaskRequired Verification
Unintended Model RemovalConfirm no unrelated provider model entries were accidentally deleted from the directory
Correct Model TypesEnsure all updated or newly added model entries use the intended, correct type definitions
Asset File InclusionCheck that any new provider logo or channel-avatar files required for your changes are included in the tracked diff changes

This manual review prevents accidental data loss, incorrect model configurations, and missing assets that automated testing might not catch.

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.