Skip to content

feat(acp): auto-populate available_models from configured LLM providers #983

@bug-ops

Description

@bug-ops

Part of epic #978.

Problem

available_models in AcpConfig is a static list in config.toml that the user must
maintain manually. As seen in Zed's model picker (built-in agents show all provider
models dynamically), users expect to see all models that Zeph has access to — grouped
by provider — without manual configuration.

Current flow:

config.toml [acp] available_models = ["claude-opus-4-6", "gpt-4o"]
    → AcpAgentState::available_models
    → SessionModelState { available_models }
    → Zed model picker

Desired flow:

LlmOrchestrator::list_models() (per-provider)
    → deduplicated, sorted list
    → SessionModelState { available_models }
    → Zed model picker (shows all configured models automatically)

Design

  1. Add list_models() -> Vec<String> method to LlmProvider trait in
    zeph-llm/src/provider.rs — returns model IDs this provider supports.
  2. Implement for ClaudeProvider, OpenAiProvider, OllamaProvider:
    • Claude/OpenAI: return static list of known models (from config model field + known variants)
    • Ollama: query local API GET /api/tags to list installed models
  3. In LlmOrchestrator (zeph-llm): aggregate list_models() across all providers.
  4. In src/acp.rs: if config.acp.available_models is empty, populate from
    orchestrator.list_models() at startup.
  5. Keep manual config.toml override working (non-empty list takes precedence).

Acceptance criteria

  • When [acp] available_models = [], Zed model picker shows all models from
    configured providers automatically
  • Ollama models reflect currently installed models at startup
  • Static override (available_models = [...] in config) still works
  • Model IDs shown in picker match IDs accepted by /model <id> command

Files

  • crates/zeph-llm/src/provider.rs — add list_models() to trait
  • crates/zeph-llm/src/claude.rs, openai.rs, ollama.rs — implement trait method
  • crates/zeph-llm/src/orchestrator.rs — aggregate across providers
  • src/acp.rs — auto-populate if config list is empty
  • crates/zeph-core/src/config/types.rs — document new auto-discovery behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestllmLLM provider related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions