Using OpenDataSky API with Dify
Dify is an open-source Large Language Model (LLM) application development platform that combines Backend as a Service (BaaS) and LLMOps methodologies. It enables developers to rapidly build production-grade generative AI applications. Even non-technical users can participate in defining AI applications and managing data operations. For more details, visit the Dify Official Documentation.
Installing Dify (Community Edition)
The Dify Community Edition supports Windows, macOS, and Linux operating systems. Refer to the official documentation to choose the deployment method that suits your environment.
Configuration
This guide focuses on the Dify Community Edition. For other versions, refer to their respective documentation.
Initial Setup
- Upon first launch, create an admin account by following the on-screen prompts.
- Log in to the admin account and navigate to Settings > Model Providers to configure the LLM API.
Select Model Provider
- Choose "OpenAI-API-compatible" as the model provider.
- Choose "OpenAI-API-compatible" as the model provider.
Add Models
- Click "Add Model" and select the model type: "LLM" (for text generation) or "Text Embedding" (for embeddings).
- Model Name: Enter the Model ID from OpenDataSky.
- For LLM models, use IDs from the Text Models section.
- For Text Embedding models, use IDs from the Embedding Models section.
- API Key: Use your OpenDataSky account’s API key. Retrieve it from the API Key Management page.
- API Endpoint URL: Enter
http://server.opendatasky.com/v1/api/open-ai/ds
.
Configure Model Parameters
- Set the following parameters based on your selected model:
- Context Length (Token Context Window):
- LLM Models: e.g.,
128000
(for 128k context). - Text Embedding Models: e.g.,
4096
.
- LLM Models: e.g.,
- Max Tokens: For LLM models, set a value like
1024
.
- Context Length (Token Context Window):
- Save the configuration.
- Set the following parameters based on your selected model:
Notes
- Ensure the Model ID matches the specifications in the Model List.
- Adjust context and token limits according to your selected model’s documentation.
By following these steps, you can integrate OpenDataSky’s models into Dify to build custom AI applications efficiently.