SiliconFlow

Interact with SiliconFlow AI models

Actions3

Overview

This node interacts with SiliconFlow AI models to perform chat completions, embeddings generation, and reranking tasks. Specifically for the Chat - Complete operation, it sends a conversation prompt or a series of messages to a selected AI model and receives a generated chat completion in response.

Common scenarios where this node is beneficial include:

  • Building conversational AI assistants that generate replies based on user input.
  • Automating customer support chatbots.
  • Generating creative text completions or responses in interactive applications.
  • Experimenting with different AI models for chat-based tasks.

For example, you can provide a sequence of messages representing a conversation history, and the node will return the next assistant message generated by the chosen model.

Properties

Name Meaning
Model The AI model used for generating the chat completion. Options include various Qwen, GLM, DeepSeek, Hunyuan, MiniMax models, etc.
Messages A collection of messages forming the conversation history. Each message has a Role (System, User, Assistant) and Content (text). This is the main input for context-aware chat completions.
Prompt A simple alternative to Messages. A single prompt string representing the user's input message.
Output Mode Determines the format of the output:
• Simple (Message Only): returns only the generated message content as a string.
• Detailed (With Metadata): returns an object including message content, usage stats, metadata.
Additional Fields Optional parameters to customize the completion request:
- Max Tokens: max tokens to generate (1-16384)
- Temperature: randomness degree (0-2)
- Top P: nucleus sampling parameter (0-1)
- Top K: top-k sampling
- Min P: dynamic filtering threshold (Qwen3 models)
- Frequency Penalty: penalizes repeated tokens
- Number of Generations: how many completions to generate
- Enable Thinking: toggle chain-of-thought mode (Qwen3/Hunyuan)
- Thinking Budget: max tokens for reasoning output
- Stop Sequences: sequences to stop generation
- Stream: whether to stream partial results
- Response Format: output type (Text or JSON Object)

Output

The node outputs an array of items, each containing a json field with the completion result:

  • In Simple mode, json contains a string with the generated message content.
  • In Detailed mode, json is an object with:
    • message: the generated message content string.
    • model: the model identifier used.
    • finishReason: why the generation stopped.
    • usage: token usage statistics.
    • Optionally, reasoning: chain-of-thought content if available.
    • Optionally, toolCalls: any tool call metadata from the model.
    • _rawResponse: the full raw API response for debugging or extended use.

No binary data output is produced by this node.

Dependencies

  • Requires an active SiliconFlow AI API key credential configured in n8n.
  • Makes HTTP POST requests to the SiliconFlow API endpoint /chat/completions.
  • Uses Axios library internally for HTTP requests.
  • Requires network access to the configured SiliconFlow API base URL.

Troubleshooting

  • Error: "Either messages or prompt must be provided"
    Occurs if neither messages nor prompt inputs are given. Provide at least one to proceed.

  • No response received from the model
    Indicates the API returned no choices. Check API key validity, model availability, and request parameters.

  • API authentication errors
    Ensure the API key credential is correctly set up and has necessary permissions.

  • Invalid parameter values
    Parameters like max_tokens, temperature, top_p, etc., have defined ranges. Values outside these may cause errors.

  • Streaming issues
    If streaming is enabled but not supported by environment or network, consider disabling the stream option.

  • Rate limits or quota exceeded
    The SiliconFlow API may enforce usage limits; monitor your account and handle errors accordingly.

Links and References

Discussion