Dify
Dify is an open-source LLMOps platform for building AI applications, chatbots, and agents with a visual workflow interface.
Prerequisites
A Dify instance (self-hosted or Dify Cloud)
Your TensorX API key from app.tensorx.ai
Configuration
Dify connects to TensorX through the OpenAI API Compatible plugin, which supports custom OpenAI-compatible endpoints.
Step 1: Install the Plugin
Go to your Dify workspace
Navigate to Plugins in the left sidebar
Search for OpenAI API Compatible
Click Install to add the plugin
Step 2: Add Model Provider
Go to Settings → Model Providers
Find OpenAI API Compatible in the list
Click Add Model
Step 3: Configure the Model
Fill in the configuration form:
Model Type
LLM
Model Name
An ID returned by GET /v1/models
API Key
Your TensorX API key
API Endpoint URL
https://api.tensorx.ai/v1
Click Save to add the model.
Step 4: Add More Models (Optional)
Repeat Step 3 with other IDs returned by GET /v1/models. Query GET /v1/model/info when a workflow requires a specific capability.
Using TensorX Models
In Chat Applications
Create a new Chatbot or Agent application
In the orchestration panel, click the model selector
Select your configured TensorX model
Adjust parameters (temperature, max tokens) as needed
In Workflows
Create a new Workflow application
Add an LLM node to your workflow
Select your TensorX model from the dropdown
Configure the prompt and parameters
Model selection
Call GET /v1/models with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query GET /v1/model/info before selecting the model. See Models for examples.
Advanced Configuration
Adding Embedding Models
To use TensorX for text embeddings:
Go to Settings → Model Providers
Click Add Model under OpenAI API Compatible
Set Model Type to
Text EmbeddingEnter the embedding model name
Configure API key and endpoint URL
Adding Speech Models
For text-to-speech or speech-to-text:
Add a new model with type
TTSorSpeech2TextUse the appropriate TensorX audio model
Configure API key and endpoint URL
Agent Configuration
When building agents that use tools:
Query
GET /v1/model/infoand select a model whosesupports_function_callingvalue istrueEnable Function Calling in the agent settings
Add your desired tools from the Dify tool library
Configure tool permissions and parameters
Example: Building a Code Assistant
Create a new Agent application
Select a model ID returned by
GET /v1/modelsAdd a system prompt:
Enable tools like Code Interpreter if available
Set temperature to
0.3for more deterministic outputsPublish your application
Troubleshooting
"Model Not Found" Error
Ensure you're using the full model ID (e.g.,
z-ai/glm-5.2)Verify the API Endpoint URL is exactly
https://api.tensorx.ai/v1
"Authentication Failed" Error
Check that your API key is correct
Verify the key at app.tensorx.ai
Ensure there are no extra spaces in the API key field
Model Not Appearing in Selector
Confirm the plugin is installed and enabled
Check that the model was saved successfully in Model Providers
Refresh the page or restart the application
Slow Responses
Check your Dify instance's network connection
Consider using a model with faster response times
Enable streaming in the application settings
Support
Need help? Contact us at support@tensorx.ai
Last updated
Was this helpful?

