mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
109 lines
4.5 KiB
Plaintext
109 lines
4.5 KiB
Plaintext
---
|
|
dimensions:
|
|
type:
|
|
primary: reference
|
|
detail: core
|
|
level: beginner
|
|
standard_title: Model Plugin Introduction
|
|
language: en
|
|
title: Model Plugins
|
|
description: Introduction to the basic concepts and structure of model plugins. Model
|
|
plugins allow Dify to call various models from different providers (such as OpenAI,
|
|
Anthropic, Google, etc.), including large language models (LLMs), text embeddings,
|
|
speech-to-text, and other types.
|
|
---
|
|
|
|
Model plugins enable the Dify platform to call all LLMs from a specific model provider. For example, after installing the OpenAI model plugin, the Dify platform can call models provided by OpenAI such as `GPT-4`, `GPT-4o-2024-05-13`, etc.
|
|
|
|
## Model Plugin Structure
|
|
|
|
To facilitate understanding the concepts involved in developing model plugins, here is a brief introduction to the structure within model plugins:
|
|
|
|
- **Model Provider**: Companies that develop large models, such as **OpenAI, Anthropic, Google**, etc.
|
|
- **Model Categories**: Depending on the model provider, there are categories like Large Language Models (LLM), Text Embedding models, Speech-to-Text models, etc.
|
|
- **Specific Models**: `claude-3-5-sonnet`, `gpt-4-turbo`, etc.
|
|
|
|
Code hierarchy structure in plugin projects:
|
|
|
|
```bash
|
|
- Model Provider
|
|
- Model Category
|
|
- Specific Models
|
|
```
|
|
|
|
Taking **Anthropic** as an example, the model plugin structure looks like this:
|
|
|
|
```bash
|
|
- Anthropic
|
|
- llm
|
|
claude-3-5-sonnet-20240620
|
|
claude-3-haiku-20240307
|
|
claude-3-opus-20240229
|
|
claude-3-sonnet-20240229
|
|
claude-instant-1.2
|
|
claude-instant-1
|
|
```
|
|
|
|
Taking OpenAI as an example, since it supports multiple model types, there are multiple model categories, structured as follows:
|
|
|
|
```bash
|
|
├── models
|
|
│ ├── llm
|
|
│ │ ├── chatgpt-4o-latest
|
|
│ │ ├── gpt-3.5-turbo
|
|
│ │ ├── gpt-4-0125-preview
|
|
│ │ ├── gpt-4-turbo
|
|
│ │ ├── gpt-4o
|
|
│ │ ├── llm
|
|
│ │ ├── o1-preview
|
|
│ │ └── text-davinci-003
|
|
│ ├── moderation
|
|
│ │ ├── moderation
|
|
│ │ └── text-moderation-stable
|
|
│ ├── speech2text
|
|
│ │ ├── speech2text
|
|
│ │ └── whisper-1
|
|
│ ├── text_embedding
|
|
│ │ ├── text-embedding-3-large
|
|
│ │ └── text_embedding
|
|
│ └── tts
|
|
│ ├── tts-1-hd
|
|
│ ├── tts-1
|
|
│ └── tts
|
|
```
|
|
|
|
## Model Configuration
|
|
|
|
Model plugins define model behavior and properties through configuration files. For detailed model design rules and configuration formats, please refer to the [Model Design Rules](/plugin-dev-en/0411-model-designing-rules) document and [Model Schema](/plugin-dev-en/0412-model-schema) specifications.
|
|
|
|
## Further Reading
|
|
|
|
- [Quick Integration of a New Model](/plugin-dev-en/0211-getting-started-new-model) - Learn how to add new models for already supported providers
|
|
- [Model Design Rules](/plugin-dev-en/0411-model-designing-rules) - Learn detailed specifications for model configuration
|
|
- [Model Schema](/plugin-dev-en/0412-model-schema) - Gain a deeper understanding of model plugin architecture
|
|
- [General Specification Definitions](/plugin-dev-en/0411-general-specifications) - Learn how to define plugin metadata
|
|
- [Basic Concepts of Plugin Development](/plugin-dev-en/0111-getting-started-dify-plugin) - Return to the plugin development getting started guide
|
|
|
|
{/*
|
|
Contributing Section
|
|
DO NOT edit this section!
|
|
It will be automatically generated by the script.
|
|
*/}
|
|
|
|
<CardGroup cols="2">
|
|
<Card
|
|
title="Edit this page"
|
|
icon="pen-to-square"
|
|
href="https://github.com/langgenius/dify-docs/edit/main/plugin-dev-en/0411-model-plugin-introduction.mdx"
|
|
>
|
|
Help improve our documentation by contributing directly
|
|
</Card>
|
|
<Card
|
|
title="Report an issue"
|
|
icon="github"
|
|
href="https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20model-plugin-introduct&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fplugin-dev-en%2F0411-model-plugin-introduction.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
|
>
|
|
Found an error or have suggestions? Let us know
|
|
</Card>
|
|
</CardGroup>
|