Quick Start

This chapter ships a Chatbot and the first real reply: one working model, a short system prompt, one message in the preview pane. No knowledge base and no tools yet.


0. Connect one model first

Studio preview cannot run without a model provider.

  1. As Owner / Admin, open Integrations → Model Provider
  2. Install OpenAI, Anthropic, or a regional provider such as DeepSeek or Qwen / Tongyi
  3. Click Setup on the card and paste the API key (plus a custom endpoint if you use one)
  4. Wait until Dify validates the credentials

For a machine-local model, follow Ollama Integration and come back. On Cloud, trial credits may let you skip your own key for this chapter.

You can also set Default Models (reasoning, embedding, …) so apps that do not pick a model fall back here. Details: Model Providers.


1. Create a Chatbot

In Studio, create an app of type Chatbot (docs also recommend Workflow / Chatflow; Chatbot is the shortest Hello World).

Fill in:

  • Name: e.g. hello-dify
  • Description (optional): so you can find it later
  • Prompt: keep it short and testable, for example:
You are a teaching assistant. Answer in concise English.
If the question is outside general knowledge and no source is provided, say you do not know. Do not invent facts.

Save and open the studio. The right side is usually Debug & Preview: pick the model you just added and send “Introduce yourself in one sentence.”

Success: a reply in a few seconds—not provider_not_initialize or “no model configured.”


2. What the first chat actually tests

You doThe platform does
Pick a modelCalls Chat with the workspace’s validated credentials
Write a promptApplies it as the system constraint for the whole thread
Send a user messageIncludes recent turns (the Chatbot keeps a session)
Read the replyThe same path later backs the Web App and /v1/chat-messages

If the model rambles, fix the prompt before you add a knowledge base. Once it follows instructions, continue at Knowledge Base.

Optional App Toolkit features (openers, follow-ups, moderation—labels vary by version) can stay off for lesson one.


3. Swap models (optional)

Resend the same user line with a smaller or cheaper model. Check latency, tone, whether it still admits “I don’t know,” and instruction-following.

Agent preview can debug as multiple models (up to about four). On a Chatbot, switching by hand is enough. Comparing two models beats installing ten providers.


4. Smallest publish (optional)

When preview looks right, click Publish. Start with the Web App only: a shareable chat page so a colleague can try without Studio access. API keys and curl live in Publish & API.

Service API conversations do not share conversation_id with the Web App—even for the same user id.


First checklist

  1. Sign in on Cloud or http://localhost
  2. Add a provider and wait for a successful validation
  3. Create a Chatbot with a three-line prompt
  4. Finish one Q&A in preview
  5. (Optional) Compare models; open the Web App in another browser

Common blockers

Preview says no model? Re-check Model Provider validation and that the app actually selected that model.

OpenAI times out? Switch to another provider, or self-host and attach Ollama.

It insists it is ChatGPT? Tighten identity and refusal rules, and confirm you selected your configured model.


Next steps

评论