Skip to content

feat: Add standalone agent run mode inspired by LocalAGI#8974

Open
localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot:task-8960-standalone-agent-mode
Open

feat: Add standalone agent run mode inspired by LocalAGI#8974
localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot:task-8960-standalone-agent-mode

Conversation

@localai-bot
Copy link
Contributor

Add standalone agent run mode

This PR adds support for running agents in standalone mode, similar to LocalAGI's agent run command.

Features

  • local-ai agent run <agent_name>: Run an agent by its ID from the registry
  • local-ai agent run --config <file>: Run an agent from a JSON config file
  • local-ai agent run <agent_name> --prompt "...": Foreground mode with single prompt
  • Interactive mode: Continuous interaction with the agent

Implementation Details

  • Added new AgentCMD struct in core/cli/agent.go
  • Registered the agent subcommand in core/cli/cli.go
  • Integrates with existing AgentPoolService for agent management
  • Supports all existing agent pool configuration options

Usage Examples

# Run an agent by name
local-ai agent run my-agent

# Run an agent with a single prompt
local-ai agent run my-agent --prompt "Analyze this text"

# Run an agent from a config file
local-ai agent run --config agent-config.json

# Run in interactive mode (default)
local-ai agent run my-agent
> Your prompt here

Related

Fixes #8960

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit af845bf
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69b2b601d194db0008511c45
😎 Deploy Preview https://deploy-preview-8974--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Add 'agent' subcommand to LocalAI CLI
- Implement 'agent run' command with standalone mode
- Support running agents by ID from registry
- Support running agents from JSON config files
- Implement foreground mode with --prompt flag
- Add interactive mode for continuous agent interaction
- Integrate with existing agent pool service

This implementation follows the LocalAGI pattern for standalone agent execution:
- local-ai agent run <agent_name> - Run an agent by name
- local-ai agent run --config <file> - Run from config file
- local-ai agent run <agent_name> --prompt "..." - Foreground mode with single prompt
@localai-bot localai-bot force-pushed the task-8960-standalone-agent-mode branch from c8ad4b5 to af845bf Compare March 12, 2026 12:47
@localai-bot
Copy link
Contributor Author

Fixed DCO issue by amending commit with proper author information. CI checks should now be re-run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Add standalone agent run mode inspired by LocalAGI

1 participant