DeepSeek icon

DeepSeek

Consume DeepSeek AI

Actions2

Overview

This node integrates with the DeepSeek AI platform to generate text completions based on chat-style prompts. It is designed for scenarios where users want to interact with an AI language model by sending a sequence of messages (roles like user, assistant, system) and receiving generated responses. Typical use cases include building conversational agents, automating customer support replies, generating creative content, or summarizing information.

For example, a user can provide a conversation history as input messages and receive the AI's next reply. The node supports selecting different AI models and tuning generation parameters such as temperature and penalties to control output randomness and repetition.

Properties

Name Meaning
Model The AI model used to generate the completion. Options are dynamically loaded from the API and filtered to those starting with "deepseek-".
Prompt A collection of messages forming the chat prompt. Each message has:
• Role: one of Assistant, System, or User.
• Content: the text content of the message. Multiple messages can be added and ordered.
Simplify Boolean flag indicating whether to return a simplified response containing only the main data (choices) instead of the full raw API response. Defaults to true.
Options Additional optional parameters to customize the completion:
• Frequency Penalty: Penalizes repeated tokens (range -2 to 2).
• Maximum Number of Tokens: Max tokens to generate (up to 32768).
• Presence Penalty: Encourages new topics (range -2 to 2).
• Sampling Temperature: Controls randomness (0 to 1).
• Top P: Nucleus sampling parameter (0 to 1).
• Response Format: JSON object specifying output format.
• Logprobs: Whether to return log probabilities of output tokens.
• Top Logprobs: Number of top tokens with log probabilities to return (requires Logprobs=true).

Output

The node outputs JSON data representing the AI completion response. By default (when "Simplify" is enabled), the output contains a data field holding the array of completion choices returned by the API under response.body.choices. This typically includes generated text and metadata per choice.

If "Simplify" is disabled, the node returns the full raw response from the API, which may contain additional details beyond just the choices.

The node does not output binary data.

Dependencies

  • Requires an active connection to the DeepSeek AI API endpoint.
  • Needs an API authentication credential configured in n8n (an API key or token).
  • The base URL for requests defaults to http://127.0.0.1:1234/v1 but should be configured appropriately for the actual DeepSeek service endpoint.
  • The node dynamically fetches available models from the /models API route.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Selecting a model that does not start with "deepseek-" might result in no valid options or errors.
    • Providing malformed or incomplete message prompts could lead to unexpected API errors.
    • Setting incompatible options (e.g., top_logprobs without enabling logprobs) may cause request rejections.
  • Error messages:

    • Authentication errors: Verify API key/token is correctly set in n8n credentials.
    • Model not found or invalid model ID: Ensure the model selection matches available DeepSeek models.
    • Request validation errors: Check that numeric parameters are within allowed ranges and required fields are provided.
    • Network errors: Confirm the API base URL is reachable and correct.

Links and References

Discussion