Dify verbinden met OpenLLM Buddy

Connect Dify to OpenLLM Buddy with the OpenAI-API-compatible model provider, then use it in chatbots, agents, and workflows.

No-code, automatisering en domotica · Integratiegids

Wat is Dify?

Dify is an open-source platform for building LLM apps visually: chatbots, agents, RAG knowledge bases, and multi-step workflows. Bezoek Dify.

Waarom OpenLLM Buddy verbinden?

Dify's OpenAI-API-compatible provider takes a model name, key, and endpoint, so your OpenLLM Buddy deployment becomes a selectable model across every app you build.

Maak voordat je begint een API-sleutel aan in de console en deploy een model. Gaat er iets mis, voer dan eerst de curl-test in stap 4 uit: geen enkele tool kan een kapot endpoint repareren.

1

Install the compatible provider

In Dify, open Settings → Model Provider. Find OpenAI-API-compatible and install it if it is not already installed.

2

Add your model

Click Add Model on the provider and fill in the form.

  • Model Type: LLM
  • Model Name: gemma4:26b
  • API Key: your OpenLLM Buddy key
  • API endpoint URL: https://openllmbuddy-proxy.botbuddytech.workers.dev/v1
  • Model context size: your deployment's context length, for example 32768
  • Turn on Function calling support only if the model supports tool calls.

Save. Dify tests the connection and shows an error if the URL or key is wrong.

3

Use it in an app

Create a chatbot, agent, or workflow, and choose the model you just added in the LLM node or the model picker.

4

Het endpoint testen met curl

Controleer of sleutel, URL en model-ID werken voordat je Dify debugt. Een kort JSON-antwoord betekent dat het endpoint gezond is.

Terminal
bash
curl -sS https://openllmbuddy-proxy.botbuddytech.workers.dev/v1/chat/completions   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"model": "gemma4:26b", "messages": [{"role": "user", "content": "Reply with OK"}], "max_tokens": 16}'

Probleemoplossing

  • Cannot reach the endpoint from self-hosted Dify — the API container needs outbound internet access. Check Docker network and proxy settings.
  • Agent will not call tools — enable function calling on the model entry and use a model that supports it.
  • 401 of 403 — de API-sleutel is fout, ingetrokken of mist het voorvoegsel Bearer . Maak een nieuwe sleutel aan in de console.
  • 404 op /chat/completions — de base-URL moet eindigen op /v1, zonder /chat/completions erachter en zonder extra pad.
  • Model niet gevonden — het model-ID moet exact overeenkomen met je deployment. Voer de curl-test uit en kopieer het ID dat je hebt gebruikt.
  • Time-outs bij het eerste verzoek — een GPU die inactief was, is mogelijk nog bezig het model te laden. Probeer het na een minuut opnieuw.
  • Verbinding geweigerd vanuit Docker of een externe host — gebruik de openbare HTTPS-base-URL, nooit localhost.

Verbindingsgegevens

Gebruik deze waarden overal waar Dify om een OpenAI-compatible provider vraagt.

Referentie
text
Base URL:  https://openllmbuddy-proxy.botbuddytech.workers.dev/v1
Chat URL:  https://openllmbuddy-proxy.botbuddytech.workers.dev/v1/chat/completions
API-sleutel: je sleutel uit de console
Model-ID:  gemma4:26b