Skip to main content

Overview

Dify is an open-source LLM application development platform that supports workflow orchestration, RAG, Agents, and more.

Configuration Steps

1

Go to Model Providers

Log in to the Dify dashboard, go to SettingsModel Providers
2

Add OpenAI-Compatible Model

Click OpenAI-API-compatible and fill in:
  • Model Name: gpt-4o (or another model)
  • API Key: sk-xxx
  • API Base URL: https://crazyrouter.com/v1
3

Configure Model Parameters

  • Model Type: Select LLM / Text Embedding / Rerank based on the model
  • Context Length: Set according to the model (e.g. 128000 for gpt-4o)
  • Max Tokens: Set maximum output length
4

Save and Test

Click save and select the model in an application to test.

Add Embedding Model

In Model Providers, add:
  • Model Name: text-embedding-3-large
  • Model Type: Text Embedding
  • API Base URL: https://crazyrouter.com/v1

Add Rerank Model

  • Model Name: BAAI/bge-reranker-v2-m3
  • Model Type: Rerank
  • API Base URL: https://crazyrouter.com/v1
Dify supports configuring multiple model providers simultaneously. It’s recommended to configure separate models for different purposes (chat, embedding, reranking).