LLM Node#
Overview#
LLMNode generates AI responses using Large Language Models. It handles streaming generation, interrupt mechanisms, and editing capabilities.
Its key features include:
Streaming Generation
Real-time output:
self.console.stream(generation_stream, use_markdown=True)Interrupt support: Uses
self.interrupt_eventfor interruptionMarkdown rendering:
use_markdown=Truefor rich output
Editing Support
Edit handling: Processes
EditExtraInfowithedit_prefixandcontent_before_editResampling: Regenerates content when
resample=TrueContext preservation: Maintains conversation context across edits
Command Integration
Tool integration: Uses
TOOLS.get_tools_description()in system promptCommand extraction: Commands extracted by
extract_commands()utilityMultiple types: Supports bash, key, subtask, context commands
Configuration#
The LLMNode is configured via both the workflow_config and the models field in the global configuration file (you can edit via autopilot config edit command). A sample configuration for models is shown below. This configuration defines two parts:
model selection and credentials: defines how to access the LLM API.
model priority: if the user does not specify the model in the
workflow_config, theLLMNodewill use the model with the highest priority.
models:
- name: deepseek
credentials:
api_key: xxxx
base_url: https://api.deepseek.com
parameters:
model: deepseek-chat
priority: 0
- name: gemini
credentials:
api_key: xxx
base_url: https://generativelanguage.googleapis.com/v1beta/openai/
parameters:
model: gemini-1.5-flash
priority: 0
If the user wants to select the model to use without modifying the priority, they can set the model field in the workflow_config to the name of the model. For example, if the user wants to use the deepseek model, they can set the workflow_config to:
workflow_config = WorkflowConfig(
model="deepseek",
...
)