Dify¶
Dify supports adding a custom OpenAI-API-compatible model provider, which is how it talks to Modelship.
- In Dify, go to Settings → Model Provider and add an OpenAI-API-compatible provider (Dify lists this as a distinct provider type from "OpenAI").
- Set the API Base to
http://<modelship-host>:8000/v1. - Set the API Key to a real key if
MSHIP_API_KEYSis configured, or any non-empty placeholder if not. - Add a model entry for each model name in your
models.yaml(Dify needs the model registered explicitly per provider — it doesn't auto-discover viaGET /v1/models), matching its type (chat, embeddings, etc.) to the corresponding Modelship deployment.
Once registered, use that model like any other inside Dify's chatflow/agent
builder. Streaming, embeddings (for Dify's knowledge-base retrieval), and
tool calling all route through the same /v1 endpoints Modelship already
exposes.