SL LLMs icon

SL LLMs

StrangeLogic LLM Node

Overview

This node integrates with StrangeLogic's Large Language Models (LLMs) to generate text or process videos based on user input. The primary use case is generating natural language responses from prompts using various AI models, which can be customized with parameters controlling randomness, response length, and safety filters. It also supports video processing by sending a video URL along with a prompt for analysis or transformation.

Practical examples include:

  • Generating creative content, summaries, or answers to questions.
  • Applying safety filters to block hate speech, harassment, sexual content, or dangerous content in generated text.
  • Processing videos by providing a URL and a prompt describing the desired operation.

Properties

Name Meaning
Operation Choose between "Generate Text" or "Process Video".
Model Name or ID Select an AI model from a dynamically loaded list or specify a model ID via expression.
Prompt The input text prompt that the LLM will respond to or that describes the video processing request.
Temperature Controls randomness in text generation; higher values produce more diverse outputs.
Max Tokens Maximum length of the generated text response.
Top P Nucleus sampling parameter controlling token selection breadth during generation.
Top K Limits token selection to the top K candidates during generation.
Safety Settings: Hate Block Level of filtering for hate speech content ("None", "Low", "Medium", "High"). Applies only to certain models.
Safety Settings: Harassment Block Level of filtering for harassment content ("None", "Low", "Medium", "High"). Applies only to certain models.
Safety Settings: Sexual Block Level of filtering for sexual content ("None", "Low", "Medium", "High"). Applies only to certain models.
Safety Settings: Dangerous Content Block Level of filtering for dangerous content ("None", "Low", "Medium", "High"). Applies only to certain models.
JSON Response When enabled, requests the response in JSON format instead of plain text. Available for select models.

Output

The node outputs an array of items where each item contains a json field holding the response from the API:

  • For text generation, the json field contains the generated text or a JSON object if JSON Response is enabled.
  • For video processing, the json field contains the processed video data or analysis returned by the API.

No binary data output is indicated.

Dependencies

  • Requires an API key credential for authentication with the StrangeLogic AI service.
  • The node makes HTTP POST requests to the StrangeLogic API endpoints:
    • /llms for text generation.
    • /process-video for video processing.
  • The domain and API key are obtained from the configured credentials.
  • The list of available models is dynamically loaded from https://ai.system.sl/llm-models.

Troubleshooting

  • No credentials returned!
    This error occurs if the required API key credential is not set up or accessible. Ensure the API key credential is properly configured in n8n.

  • Invalid response from API: Expected an array of models.
    Happens when loading models fails due to unexpected API response. Check network connectivity and API availability.

  • API request errors
    If the API returns an error during execution, the node either throws an error or continues on fail depending on configuration. Common causes include invalid model IDs, malformed prompts, or exceeding token limits.

  • Model-specific safety settings not applying
    Safety filter options only appear for specific models (models/gemini-1.5-flash, models/gemini-1.5-pro). Using other models will ignore these settings.

Links and References

Discussion