- Model provider rules are based on the Provider entity.
- Model rules are based on the AIModelEntity entity.
All entities below are based onPydantic BaseModel, and can be found in theentitiesmodule.
Provider
provider(string) Provider identifier, e.g.:openailabel(object) Provider display name, i18n, can set bothen_US(English) andzh_Hans(Chinese) languageszh_Hans(string) [optional] Chinese label, if not set, will default to usingen_USen_US(string) English label
description(object) [optional] Provider description, i18nzh_Hans(string) [optional] Chinese descriptionen_US(string) English description
icon_small(string) [optional] Provider small icon, stored in the_assetsdirectory under the corresponding provider implementation directory, same language strategy aslabelzh_Hans(string) [optional] Chinese iconen_US(string) English icon
icon_large(string) [optional] Provider large icon, stored in the_assetsdirectory under the corresponding provider implementation directory, same language strategy as labelzh_Hans(string) [optional] Chinese iconen_US(string) English icon
background(string) [optional] Background color value, e.g.: #FFFFFF, if empty, will display the frontend default color valuehelp(object) [optional] Help informationtitle(object) Help title, i18nzh_Hans(string) [optional] Chinese titleen_US(string) English title
url(object) Help link, i18nzh_Hans(string) [optional] Chinese linken_US(string) English link
supported_model_types(array[ModelType]) Supported model typesconfigurate_methods(array[ConfigurateMethod]) Configuration methodsprovider_credential_schema([ProviderCredentialSchema]) Provider credential specificationsmodel_credential_schema([ModelCredentialSchema]) Model credential specifications
AIModelEntity
model(string) Model identifier, e.g.:gpt-3.5-turbolabel(object) [optional] Model display name, i18n, can set bothen_US(English) andzh_Hans(Chinese) languageszh_Hans(string) [optional] Chinese labelen_US(string) English label
model_type(ModelType) Model typefeatures(array[ModelFeature]) [optional] List of supported featuresmodel_properties(object) Model propertiesmode(LLMMode) Mode (available for model typellm)context_size(int) Context size (available for model typesllmandtext-embedding)max_chunks(int) Maximum number of chunks (available for model typestext-embedding moderation)file_upload_limit(int) Maximum file upload limit, unit: MB. (available for model typespeech2text)supported_file_extensions(string) Supported file extension formats, e.g.: mp3,mp4 (available for model typespeech2text)default_voice(string) Default voice, required: alloy,echo,fable,onyx,nova,shimmer (available for model typetts)voices(list) List of available voices.mode(string) Voice model. (available for model typetts)name(string) Voice model display name. (available for model typetts)language(string) Supported languages for voice model. (available for model typetts)
word_limit(int) Word limit for single conversion, defaults to paragraph segmentation (available for model typetts)audio_type(string) Supported audio file extension formats, e.g.: mp3,wav (available for model typetts)max_workers(int) Number of concurrent tasks supported for text-to-audio conversion (available for model typetts)max_characters_per_chunk(int) Maximum characters per chunk (available for model typemoderation)
parameter_rules(array[ParameterRule]) [optional] Model call parameter rulespricing([PriceConfig]) [optional] Pricing informationdeprecated(bool) Whether deprecated. If deprecated, the model list will no longer display it, but those already configured can continue to be used. Default is False.
ModelType
llmText generation modeltext-embeddingText embedding modelrerankRerank modelspeech2textSpeech to textttsText to speechmoderationContent moderation
ConfigurateMethod
predefined-modelPredefined model
customizable-modelCustomizable model
fetch-from-remoteFetch from remote
predefined-model configuration method, only unified provider credentials are needed, but the models are fetched from the provider using the credential information.
ModelFeature
agent-thoughtAgent reasoning, generally models over 70B have chain-of-thought capabilities.visionVision, i.e.: image understanding.tool-callTool callingmulti-tool-callMultiple tool callingstream-tool-callStreaming tool calling
FetchFrom
predefined-modelPredefined modelfetch-from-remoteRemote model
LLMMode
completionText completionchatChat
ParameterRule
name(string) Actual parameter name for model calluse_template(string) [optional] Use template
For details on using templates, you can refer to the examples in Creating a New Model Provider.There are 5 pre-configured variable content templates by default:
temperaturetop_pfrequency_penaltypresence_penaltymax_tokens
use_template, which will use the default configuration from entities.defaults.PARAMETER_RULE_TEMPLATE without needing to set any parameters other than name and use_template. If additional configuration parameters are set, they will override the default configuration. You can refer to openai/llm/gpt-3.5-turbo.yaml for examples.
label(object) [optional] Label, i18nzh_Hans(string) [optional] Chinese labelen_US(string) English labeltype(string) [optional] Parameter typeintIntegerfloatFloating pointstringStringbooleanBoolean
help(string) [optional] Help informationzh_Hans(string) [optional] Chinese help informationen_US(string) English help informationrequired(bool) Whether required, default is False.default(int/float/string/bool) [optional] Default valuemin(int/float) [optional] Minimum value, only applicable to numeric typesmax(int/float) [optional] Maximum value, only applicable to numeric typesprecision(int) [optional] Precision, decimal places to retain, only applicable to numeric typesoptions(array[string]) [optional] Dropdown option values, only applicable whentypeisstring, if not set or is null, then option values are not restricted
PriceConfig
input(float) Input unit price, i.e., Prompt unit priceoutput(float) Output unit price, i.e., returned content unit priceunit(float) Price unit, e.g., if priced per 1M tokens, then the unit token number corresponding to the unit price is0.000001currency(string) Currency unit
ProviderCredentialSchema
credential_form_schemas(array[CredentialFormSchema]) Credential form specifications
ModelCredentialSchema
model(object) Model identifier, default variable name ismodellabel(object) Model form item display nameen_US(string) Englishzh_Hans(string) [optional] Chinese
placeholder(object) Model prompt contenten_US(string) Englishzh_Hans(string) [optional] Chinese
credential_form_schemas(array[CredentialFormSchema]) Credential form specifications
CredentialFormSchema
variable(string) Form item variable namelabel(object) Form item labelen_US(string) Englishzh_Hans(string) [optional] Chinese
type(FormType) Form item typerequired(bool) Whether requireddefault(string) Default valueoptions(array[FormOption]) Form item attribute specific toselectorradio, defines dropdown contentplaceholder(object) Form item attribute specific totext-input, form item placeholderen_US(string) Englishzh_Hans(string) [optional] Chinese
max_length(int) Form item attribute specific totext-input, defines maximum input length, 0 means no limit.show_on(array[FormShowOnObject]) Display when other form item values meet conditions, empty means always display.
FormType
text-inputText input componentsecret-inputPassword input componentselectSingle-select dropdownradioRadio componentswitchSwitch component, only supportstrueandfalse
FormOption
label(object) Labelen_US(string) Englishzh_Hans(string) [optional] Chinese
value(string) Dropdown option valueshow_on(array[FormShowOnObject]) Display when other form item values meet conditions, empty means always display.
FormShowOnObject
variable(string) Other form item variable namevalue(string) Other form item variable value
Related Resources
- Model Architecture Details - Deep dive into the architecture specifications of model plugins
- Quickly Integrate a New Model - Learn how to apply these rules to add new models
- General Specifications - Understand the configuration of plugin manifest files
- Create a New Model Provider - Develop brand new model provider plugins
Edit this page | Report an issue