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
string
Provider identifier, for example
openai.object
object
object
string
Background color value, for example
#FFFFFF. If empty, the frontend default color is used.object
array[ModelType]
required
Supported model types.
array[ConfigurateMethod]
required
Configuration methods.
ProviderCredentialSchema
required
Provider credential specification.
ModelCredentialSchema
Model credential specification.
AIModelEntity
string
required
Model identifier, for example
gpt-3.5-turbo.object
ModelType
required
Model type.
array[ModelFeature]
Supported features.
object
required
Model properties.
LLMMode
Mode (model type
llm).integer
Context size (model types
llm and text-embedding).integer
Maximum number of chunks (model types
text-embedding and moderation).integer
Maximum file upload size in MB (model type
speech2text).string
Supported file extensions, for example
mp3,mp4 (model type speech2text).string
Default voice; one of
alloy, echo, fable, onyx, nova, shimmer (model type tts).array
integer
Word limit per conversion; defaults to splitting by paragraph (model type
tts).string
Supported audio file extensions, for example
mp3,wav (model type tts).integer
Number of concurrent text-to-audio conversion tasks (model type
tts).integer
Maximum characters per chunk (model type
moderation).array[ParameterRule]
Rules for model call parameters.
PriceConfig
Pricing information.
boolean
Whether the model is deprecated. Deprecated models no longer appear in the model list, but existing configurations keep working. Defaults to
False.ModelType
string
Text generation model.
string
Text embedding model.
string
Rerank model.
string
Speech to text.
string
Text to speech.
string
Content moderation.
ConfigurateMethod
string
Predefined model. The user configures unified provider credentials once to use all predefined models under the provider.
string
Customizable model. The user adds a credential configuration for each model.
string
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
string
Agent reasoning. Generally, models over 70B have chain-of-thought capabilities.
string
Vision (image understanding).
string
Tool calling.
string
Multiple tool calling.
string
Streaming tool calling.
FetchFrom
string
Predefined model.
string
Remote model.
LLMMode
string
Text completion.
string
Chat.
ParameterRule
string
required
Actual parameter name used in the model call.
string
Template to use.
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.
boolean
Whether the parameter is required. Defaults to
False.int/float/string/boolean
Default value.
int/float
Minimum value. Numeric types only.
int/float
Maximum value. Numeric types only.
integer
Number of decimal places to keep. Numeric types only.
array[string]
Dropdown option values. Only applies when
type is string. If not set or null, values are unrestricted.PriceConfig
float
Input (prompt) unit price.
float
Output (returned content) unit price.
float
Price unit. For example, if pricing is per 1M tokens, the unit token count corresponding to the unit price is
0.000001.string
Currency unit.
ProviderCredentialSchema
array[CredentialFormSchema]
required
Credential form specification.
ModelCredentialSchema
object
required
array[CredentialFormSchema]
required
Credential form specification.
CredentialFormSchema
string
required
Form item variable name.
FormType
required
Form item type.
boolean
Whether the form item is required.
string
Default value.
array[FormOption]
Dropdown content. Specific to the
select and radio types.object
integer
Maximum input length. Specific to the
text-input type. 0 means no limit.array[FormShowOnObject]
Show this item only when other form item values meet the given conditions. Empty means always show.
FormType
string
Text input component.
string
Password input component.
string
Single-select dropdown.
string
Radio component.
string
Switch component. Only supports
true and false.FormOption
string
required
Dropdown option value.
array[FormShowOnObject]
Show this option only when other form item values meet the given conditions. Empty means always show.
FormShowOnObject
string
required
Variable name of the other form item.
string
required
Variable value of the other form item.
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