Agentiff LLM
AI-generatedSummary
Send prompts to the Agentiff LLM Gateway API to generate AI completions using a specified large language model and return the response in various formats.
Inputs
- API Token Source (required) — Select the source for the API bearer token used for authentication: from Agentiff context (_agentiff injected JWT), from credentials stored in n8n, or a custom expression.
- API Token — Custom API token expression, shown only if API Token Source is set to Custom.
- Gateway URL — Optional URL for the LLM Gateway API; if empty, derives from credentials, context, environment variables, or uses a default URL. The /api/v1/chat/completions endpoint is appended automatically.
- Model (required) — The LLM model identifier to use. Choose from common models like GPT-4o Mini or Claude, or specify a custom model.
- Custom Model — Custom model identifier string, required if "Model" is set to Custom.
- System Prompt — An optional system prompt to provide context or instructions to the LLM. Supports expressions.
- User Prompt (required) — The main user input prompt to send to the LLM. Supports expressions.
- Response Mode (required) — Determines how the node processes the LLM response: returns only the raw text content, attempts to extract JSON from the response or returns the full LLM API response object.
- Options — Additional generation parameters including temperature (sampling randomness), max tokens to generate, top-p nucleus sampling, and request timeout in milliseconds.
Output shape
A list of items where each item contains the original input JSON merged with the LLM response data according to the Response Mode.
If Response Mode is 'Text Content', output includes 'content' string, 'model', and 'usage' info. If 'JSON Extraction', it attempts to parse JSON from the text response and includes keys 'content', 'parsed' (JSON object or null), 'json_extracted' (boolean), 'model', and 'usage'. If 'Full Response', includes the entire LLM response under 'llm_response'. On errors, the item includes an 'error' message and 'llm_success' set to false. The operation supports multiple input items and continues on failure if configured.
Examples
Example 1: Generate a response using GPT-4o Mini with a user prompt and parse JSON from the output.
Set API Token Source appropriately, choose model 'gpt-4o-mini', provide the user prompt, and set Response Mode to 'JSON Extraction'. Optionally set system prompt and advanced options like temperature and max tokens.
