Overview
Osmedeus provides three step types for LLM integration:llm— Single-shot LLM calls: chat completions, tool calling, embeddings, multimodal content, structured outputsagent— Agentic execution loop: iterative tool calling, sub-agents, memory management, planning stages, multi-goal executionagent-acp— External AI agent execution via the Agent Communication Protocol (ACP): delegates to real agent binaries (Claude Code, Codex, OpenCode, Gemini)
Configuration
Settings
Inosm-settings.yaml, configure one or more providers under llm_providers. Providers are rotated automatically across requests:
Environment Variables
Environment variables override settings for the default provider:Chat Completion
Basic Usage
Export variables are based on the sanitized step name (hyphens replaced with underscores).
A step named
analyze-results produces exports analyze_results_llm_resp (full response object) and analyze_results_content (text content only).Message Roles
Multi-turn Conversation
Tool Calling
Define Tools
Handle Tool Calls
Tool calls are exported within the_llm_resp object:
Embeddings
Generate Embeddings
Use with Files
Structured Output
JSON Schema
Configuration Override
Per-Step Config
Extra Parameters
Multimodal Content
Image Analysis
Streaming
Bothllm and agent steps support streaming output via the stream field:
stream field overrides both llm_config.stream and the global config setting.
Agent Step Type
Theagent step type provides an agentic LLM execution loop — the LLM iteratively calls tools, processes results, and reasons until completion. This is fundamentally different from the single-shot llm step.
Basic Agent
Either
query (single goal) or queries (multi-goal) is required, not both.Preset Tools
Preset tools reference built-in osmedeus functions with auto-generated schemas:Custom Tools
Define custom tools with explicit schemas and JavaScript handlers:handler is a JavaScript expression. The parsed tool call arguments are available as the args object.
Multi-Goal Execution
Usequeries to run the agent through multiple goals sequentially. Each goal is executed in order, and all results are collected:
agent_goal_results export contains results from all goals as a JSON array.
Planning Stage
Add a planning phase before the main execution loop. The agent first generates a plan, then executes it:Memory Management
Control conversation context size for long-running agents:Model Preferences
Specify preferred models tried in order. Falls back to the default provider config if none are available:Structured Output (Agent)
Enforce a JSON schema on the agent’s final output usingoutput_schema:
response_format parameter.
Sub-Agents
Define inline sub-agents that the parent agent can spawn via the auto-generatedspawn_agent tool:
sub_agents is defined, a spawn_agent tool is automatically added with parameters:
agent— Name of the sub-agent to spawn (from the defined list)query— The task to delegate
sub_agents). Use max_agent_depth to control nesting depth (default: 3).
Stop Condition
A JavaScript expression evaluated after each iteration. If it returnstrue, the agent stops:
agent_content (current response text), iteration (current iteration number).
Tool Tracing Hooks
JavaScript expressions executed before and after each tool call for logging or debugging:Parallel Tool Calls
By default, agents allow the LLM to make multiple tool calls in parallel. Disable this for sequential execution:Agent Exports
All exports available from agent steps:Agent-ACP Step Type
Theagent-acp step type spawns an external AI coding agent as a subprocess and communicates via the Agent Communication Protocol (ACP). Unlike the agent step type (which uses Osmedeus’s internal LLM loop), agent-acp delegates to real agent binaries like Claude Code, Codex, OpenCode, or Gemini.
Basic Agent-ACP
Built-in Agents
Four agents are available out of the box:
List available agents from the CLI:
Configuration Fields
agent is required unless acp_config.command is provided to specify a custom agent binary.ACP Config
Override the built-in agent or customize execution:Full Configuration Example
Custom Agent
Useacp_config.command to run any ACP-compatible agent binary:
Agent-ACP Exports
Agent CLI Command
Run an ACP agent interactively from the terminal:run_agent Utility Function
Userun_agent in function steps to invoke an ACP agent programmatically:
API Endpoints
LLM API
OpenAI-compatible API:Agent ACP API
OpenAI-compatible endpoint that spawns a local ACP agent subprocess:model field maps to the agent name (claude-code, codex, opencode, gemini). Defaults to claude-code if unrecognized.
Only one ACP agent subprocess can run at a time via the API. Concurrent requests return HTTP 409.
Providers
OpenAI
Anthropic
Ollama (Local)
Azure OpenAI
Multiple Providers (Rotation)
Configure multiple providers for automatic rotation:Workflow Functions
Use LLM functions directly in function steps without the fullllm step type.
llm_invoke
Simple LLM call with a direct message:llm_invoke_custom
LLM call with a custom POST body template. Use{{message}} as a placeholder:
llm_conversations
Multi-turn conversation usingrole:content format:
Use Cases
Vulnerability Analysis
Report Generation
Intelligent Filtering
Autonomous Reconnaissance Agent
Delegated Code Analysis (Agent-ACP)
Best Practices
- Use system prompts for consistent behavior
- Limit context size — summarize large inputs before passing to LLM
- Set
max_iterationsappropriately — higher for complex tasks, lower for simple queries - Enable memory management for long-running agents to avoid context overflow
- Use structured output when you need to parse the response programmatically
- Consider local models (Ollama) for sensitive data that shouldn’t leave your network
- Use sub-agents to decompose complex tasks into specialized subtasks
- Add
stop_conditionwhen the agent has a clear success criteria - Use
plan_promptfor complex tasks that benefit from upfront planning - Use
agent-acpwhen you need full coding agent capabilities (file editing, code generation) — useagentwhen you need fine-grained tool control within the osmedeus ecosystem - Restrict
allowed_pathsin agent-acp steps to limit file access to the workspace - Keep
write_enabled: false(default) in agent-acp unless the agent needs to create files
Next Steps
- Step Types — LLM and Agent step details
- API Overview — LLM endpoints
- Configuration — LLM settings
