Skip to main content
Every Dify app needs at least one model provider. Dify ships with a built-in catalog of providers—set one up with your API key, and all apps in the workspace can use its models.
API keys grant workspace-wide model access and trigger direct billing through each provider’s account. Only the workspace owner and admins can manage providers.

Add a Provider

  1. In Settings > Model Provider, find your provider in the catalog under Add more model provider. Providers you have already configured appear at the top of the page.
  2. Click Setup on the provider card and enter your API key (and any other required credentials, such as a custom endpoint URL or organization ID). Dify validates the credentials before making the provider available.

Add a Custom Model

Most providers bring their own models, so once you authorize one, its models are ready to use. You add a model yourself only when the one you need isn’t there, typically in two situations:
  • You run your own inference server, such as Ollama or Xinference, and Dify has no way to know which models you’ve loaded.
  • A provider lists its models, but the specific one you want, such as a newly released or fine-tuned model, is missing.
Click Add Model on the provider card, then give the model a name and its credentials. If a provider only serves a fixed set of models, it won’t offer this option.

Load Balancing

Load balancing lets you configure multiple sets of credentials for a model and distribute requests across them automatically, so no single credential hits its rate limit under heavy use. By default, Dify uses a round-robin strategy, routing each request to the next credential in the pool. If a credential triggers a rate limit, it is taken out of rotation for one minute before Dify retries it. To set it up:
  1. In the provider’s model list, hover over the model and click Config Load Balancing.
  2. Select Load Balancing, then click Add Config to add credentials to the pool.
  3. Enable at least two credentials, then click Save. Models using load balancing show a load balancing badge in the model list.

Set Default Models

Click System Model Settings in the toolbar to assign the fallback model for each category. Apps and nodes that don’t specify a model use these:
  • System Reasoning Model: the default LLM.
  • Embedding Model: used for knowledge base indexing and retrieval.
  • Rerank Model: re-ranks retrieval results by relevance.
  • Speech-to-Text Model: converts audio input to text.
  • Text-to-Speech Model: converts text responses to audio.