Learn / How to use Netra Runtime with Dify

How to use Netra Runtime with Dify

Dify is an open-source platform for building LLM apps: chatbots, agents, and workflows with a visual editor. Any model behind an OpenAI-style endpoint can be registered as a provider, which is exactly what a Netra Runtime deployment exposes. Once registered, your Netra-served model appears in Dify's model picker like any built-in provider.

What you need

  • A Dify workspace (Dify Cloud or self-hosted) with admin access to model settings.
  • A Netra Runtime API key from your dashboard at app.netraruntime.com. The API base URL is https://api.netraruntime.com/v1 (self-hosted deployments use their own endpoint URL instead).

Step 1: install the OpenAI-API-compatible provider

Open the Dify Marketplace and install the OpenAI-API-compatible plugin (published by langgenius, the Dify team). This is the provider that lets you register arbitrary OpenAI-style endpoints. On some self-hosted versions it is already available under model providers without a separate install.

Step 2: add your Netra model

Go to Settings → Model Provider → OpenAI-API-compatible → Add model and fill in:

Field Value
Model TypeLLM
Model NameThe exact model id, e.g. qwen3.6-35b (/v1/models lists the current set)
API KeyYour Netra API key
API endpoint URLhttps://api.netraruntime.com/v1
Model context sizeThe context window of your deployed model
Max tokens limitThe output cap you want per request

Enter the base URL only, not the full /chat/completions path; Dify appends the endpoint path itself. Enable streaming so chat apps render tokens as they arrive, and turn on function calling support if your deployed model handles tools.

Step 3: select the model in your app

In Dify Studio, open your app or workflow, click the model selector, and choose your Netra model under the OpenAI-API-compatible provider. It now serves chat apps, agent nodes, and LLM nodes in workflows. You can also set it as the workspace default in the system model settings.

Troubleshooting

  • Credential validation fails. Check that the endpoint URL ends at /v1 and that the model name exactly matches an id listed at /v1/models. Validation sends a tiny real request, so a wrong model id fails here.
  • Self-hosted Dify can't reach the endpoint. The Dify containers need a network route to your Netra deployment. For a private VPC endpoint, run Dify inside the same network.
  • Long answers get cut off. Raise the max tokens limit on the model entry, and check the per-app max tokens parameter in the model settings panel.

Frequently asked questions

Which Dify provider do I use for Netra Runtime?

Use the OpenAI-API-compatible provider plugin from the Dify Marketplace. It lets you register any model behind an OpenAI-style endpoint by entering the model name, API key, and endpoint URL.

Does this work on Dify Cloud and self-hosted Dify?

Both. Dify Cloud needs a Netra endpoint reachable from the public internet, while self-hosted Dify can also reach private endpoints inside your VPC or on-prem network.

Can I use Netra Runtime for embeddings in Dify?

If your Netra deployment serves an embeddings endpoint, add it as a separate model with the Text Embedding type. Don't route embeddings through a chat model entry.

Related