DigitalOcean Gradient icon

DigitalOcean Gradient

Interact with DigitalOcean Gradient AI Platform Serverless Inference

Overview

This node integrates with the DigitalOcean Gradient AI Platform to create chat completions using specified AI models. It allows users to send a sequence of messages (with roles such as system, user, or assistant) to an AI model and receive generated responses. This is useful for building conversational AI applications, chatbots, virtual assistants, or any scenario requiring natural language generation based on contextual dialogue.

Practical examples:

  • Automating customer support by generating replies based on user queries.
  • Creating interactive storytelling or game dialogues.
  • Assisting content creation by generating text continuations or suggestions.

Properties

Name Meaning
Model ID of the AI model to use for generating chat completions (e.g., "llama3.3-70b-instruct").
Messages A collection of messages forming the conversation history. Each message includes:
- Role: The role of the message sender ("System", "User", or "Assistant").
- Content: The textual content of the message.
Additional Fields Optional parameters to customize the completion behavior:
- Frequency Penalty Penalizes new tokens based on their existing frequency (range: -2 to 2).
- Max Tokens Maximum number of tokens to generate in the completion (default 100).
- Presence Penalty Penalizes new tokens based on whether they appear in the text so far (range: -2 to 2).
- Temperature Controls randomness of output; lower values make output less random (range: 0 to 1, default 0.7).
- Top P Controls diversity via nucleus sampling (range: 0 to 1, default 1).

Output

The node outputs JSON data containing the response from the DigitalOcean Gradient API's chat completion endpoint. The structure typically includes the generated text or message(s) from the AI model corresponding to the input conversation.

If multiple input items are processed, each output item corresponds to one input, paired accordingly.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the DigitalOcean Gradient AI Platform.
  • The node uses an HTTP POST request to the /chat/completions endpoint of the DigitalOcean Gradient API.
  • Proper configuration of the API authentication credential within n8n is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect model IDs may result in errors or no response.
    • Improperly formatted messages (missing roles or content) can lead to API errors.
    • Exceeding token limits or invalid parameter ranges may cause request rejections.
  • Error messages:

    • Authentication errors: Verify that the API key credential is correctly set up and has required permissions.
    • Validation errors: Check that all required fields (model, messages) are provided and valid.
    • Rate limiting or quota exceeded: May require waiting or upgrading API plan.
  • To handle errors gracefully, the node supports continuing on failure, allowing workflows to proceed even if some requests fail.

Links and References

Discussion