Dspy Acp banner
sotayamashita sotayamashita

Dspy Acp

Development community

Description

Experimental DSPy adapter for the Agent Client Protocol (ACP)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

dspy-acp

Note: This is an experimental implementation and may change without notice.

DSPy adapter for [ACP (Agent Client Protocol)](https://github.com/agentclientprotocol/agent-client-protocol) agents.

This library provides a seamless integration between [DSPy](https://github.com/stanfordnlp/dspy) and ACP-compatible agents, enabling you to use DSPy's powerful prompt optimization and evaluation capabilities with any ACP agent.

Installation

uv add git+https://github.com/sotayamashita/dspy-acp

Prerequisites

The quick start uses [codex-acp](https://github.com/zed-industries/codex-acp) as the ACP agent backend. Depending on how you install/run it, you may need:

  1. Node.js (only if you run codex-acp via npx)
  2. A ChatGPT subscription or an API key (refer to codex-acp/Codex CLI auth docs for current requirements)

Quick Start

import dspy
from dspy_acp import CodexACPAdapter

# Initialize the adapter
lm = CodexACPAdapter()
dspy.configure(lm=lm)

# Define your signature
class QA(dspy.Signature):
    """Answer the user's question."""
    question = dspy.InputField()
    answer = dspy.OutputField()

# Use DSPy modules as usual
qa = dspy.ChainOfThought(QA)
response = qa(question="What is the capital of France?")
print(response.answer)

# Clean up
lm.close()

If you use ChatGPT-based authentication, a browser window will open on first run.

Configuration

Authentication Methods

# Example auth methods for codex-acp (check codex-acp docs for current values)
lm = CodexACPAdapter(auth_method="chatgpt")
lm = CodexACPAdapter(auth_method="openai-api-key")
lm = CodexACPAdapter(auth_method="codex-api-key")

Custom ACP Agent

# Use a different ACP agent
lm = ACPAdapter(command=["path/to/your-acp-agent"])

The `auth_method` value is defined by the selected ACP agent.

Codex Models (Examples)

Codex CLI supports multiple models. Representative options include:

  • gpt-5.1-codex-max
  • `gpt-5