All entities below are
Pydantic BaseModel subclasses from the dify_plugin.entities.model module.Quick Decision
Authentication only: predefined models
User pastes an API key, gets your full model list. Set
configurate_methods: [predefined-model] and define each modelâs AIModelEntity in YAML.User-supplied models
User configures their own model name and base URL (OpenAI-compatible endpoints, custom deployments). Use
configurate_methods: [customizable-model] and see Customizable Model.Mixed
Built-in catalog plus user-added custom models. Combine both
configurate_methods values.Walkthrough
For an end-to-end example, see Creating a New Model Provider.
Provider
AIModelEntity
Model properties.
Whether the model is deprecated. Deprecated models no longer appear in the model list, but existing configurations keep working. Defaults to
False.ModelType
ConfigurateMethod
Predefined model. The user configures unified provider credentials once to use all predefined models under the provider.
Fetch from remote. Like
predefined-model, only unified provider credentials are needed, but the model list is fetched from the provider using those credentials.ModelFeature
FetchFrom
LLMMode
ParameterRule
Five parameter templates are predefined:temperaturetop_pfrequency_penaltypresence_penaltymax_tokens
use_template to inherit the default configuration from entities.defaults.PARAMETER_RULE_TEMPLATE; you then only need name and use_template. Any additional parameters you set override the template defaults. See openai/llm/gpt-3.5-turbo.yaml and the examples in Creating a New Model Provider.
Dropdown option values. Only applies when
type is string. If not set or null, values are unrestricted.PriceConfig
Price unit. For example, if pricing is per 1M tokens, the unit token count corresponding to the unit price is
0.000001.ProviderCredentialSchema
ModelCredentialSchema
CredentialFormSchema
Show this item only when other form item values meet the given conditions. Empty means always show.
FormType
FormOption
Show this option only when other form item values meet the given conditions. Empty means always show.
FormShowOnObject
Related Resources
- Model Architecture Detailsâarchitecture specifications for model plugins
- Quickly Integrate a New Modelâapply these rules to add new models
- General Specificationsâplugin manifest configuration
- Create a New Model Providerâdevelop a new model provider plugin