Skip to content

Feature request: route ACP agents (Claude Code, Qwen Code) to local Ollama models #730

Description

@ChristianLuciani

Problem

ACP agents such as Claude Code and Qwen Code are designed to call their provider's API (Anthropic, Alibaba, etc.) by default. Users who self-host Ollama cannot use these agents with local models without manually hacking environment variables (ANTHROPIC_BASE_URL, etc.).

Use case

I run Ollama locally and want to use ACP coding agents (Claude Code, Qwen Code) against local models instead of cloud APIs. Currently:

  • Claude Code hardcodes ANTHROPIC_BASE_URL → api.anthropic.com
  • Qwen Code hardcodes its provider endpoint
  • Injecting env vars globally affects ALL agents, not just the ones I want routed to Ollama

A per-agent env injection mechanism in AionCore's ACP launch policy would let users selectively route individual agents to local models while others continue using their cloud endpoints.

Prior work

I had an implementation in PR #626 (now in draft/paused) that:

  • Detected agents configured for Ollama mode
  • Injected the correct env vars (ANTHROPIC_BASE_URL, auth tokens, model pins) at ACP spawn time
  • Left non-Ollama agents untouched

Question

Is per-agent env injection for local model routing something the project would consider? Happy to refactor the approach to match the team's preferred architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions