Skip to content

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.

  1. 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.
  2. Select Model Provider

    • Choose "OpenAI-API-compatible" as the model provider.
      dify-model-provider-setting
  3. 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.
    • 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.
      dify-model-setting
  4. 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.
      • Max Tokens: For LLM models, set a value like 1024.
    • Save the configuration.
      dify-model-setting-complete

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.