Language Model Node
Generate text using a large language model
Overview
The Language Model Node is the core component of any Pathlit workflow. It enables users to generate text based on prompts and can be chained together to model complex human like decision making and behavior. This node connects to a large language model (LLM) and allows for dynamic text generation, making it suitable for various applications such as chatbots, content creation, and more.
Configuration Parameters
To set up the Language Model Node, you need to configure the following parameters:
-
Model:
Select the language model you wish to use for text generation. Hover over the model name to view a brief description of its capabilities and context window size. Custom models are also available in Team plan.
-
User Prompt:
The initial input or question you want the model to respond to.
-
Temperature:
A value between 0.0 and 2.0 that controls the randomness of the output. Lower values make the output more deterministic, while higher values increase variability.
-
Enable Conversation History:
A checkbox option that allows you to retain the conversation history for more contextual responses in ongoing interactions.
This is only available for chatbot workflows. The value of this configuration does not affect regular workflow executions.
Advanced Settings
Advanced settings panel can be expanded by clicking on the settings button on the top right corner of the node. The following additional configurations are available:
-
System Prompt:
A predefined instruction that sets the context for the model’s responses. Usually used in conjunction with the user prompt to guide the model’s output. Can be left empty if not needed.
-
Top P:
A value between 0.0 and 1.0 that controls the diversity of the output by limiting the selection to a subset of the most probable next words.
Expected Inputs and Outputs
-
Inputs: Any text input can be provided to the Language Model Node as a data source for formatting the user prompt and system prompt.
-
Outputs:
- The output will be a string that contains the text generated by the language model based on the provided prompts.
Use Case Examples
-
Chatbot Development:
You can use the Language Model Node to create a chatbot that interacts with users. By providing a user prompt, the model can generate responses that mimic human conversation, enhancing user engagement.
-
Content Creation:
Marketers can leverage this node to generate blog posts, social media content, or marketing copy by inputting specific topics or keywords as prompts.
-
Question Answering Systems:
If you have a knowledge base, you can use the Language Model Node to answer user queries by providing relevant prompts that guide the model to retrieve and generate accurate information.
-
Personalized Recommendations:
Retailers can utilize this node to generate personalized product recommendations based on user preferences input as prompts, improving customer satisfaction.
Error Handling and Troubleshooting
-
Rate Limiting:
If you encounter errors related to rate limits, it may be due to exceeding the allowed number of requests to the language model. Try using different LLM to avoid rate limiting issues.
If you encounter any issues with the Language Model Node that are not covered in this documentation, please reach out to our support team for assistance.