adapter-factory

Create CLI and HTTP adapters for AI models with configuration and testing.

1|1|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/blueman82/ai-counsel --skill adapter-factory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adapter-factory
Source: https://github.com/blueman82/ai-counsel/tree/main/.claude/skills/adapter-factory
Command: npx skills add https://github.com/blueman82/ai-counsel --skill adapter-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, tenacity, vcrpy.

What problem does it solve?

Integrating new AI models or services into the AI Counsel deliberation system requires creating custom adapters, which involves handling subprocesses, HTTP requests, parsing outputs, and managing configuration. This skill provides a comprehensive guide to streamline the process of adding new models.

Core Features & Use Cases

  • CLI Adapter Creation: Build adapters for command-line AI tools, managing subprocess execution and output parsing.
  • HTTP Adapter Creation: Integrate HTTP-based AI APIs, handling request building, response parsing, and retry logic.
  • Secure Configuration: Utilize environment variable substitution for API keys, keeping secrets out of config files.
  • Robust Testing: Implement unit tests with mocking and VCR cassettes for HTTP interactions, ensuring reliable integrations.
  • Use Case: Integrate a new local AI model served via Ollama by creating an HTTP adapter that correctly formats the API request and parses the JSON response, allowing it to participate in multi-model debates.

Quick Start

To create a new CLI adapter, create a file adapters/your_cli.py and define YourCLIAdapter inheriting from BaseCLIAdapter. Implement the parse_output method to extract the model's response from the raw CLI output.

Frequently Asked Questions about adapter-factory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a new AI model into a deliberation system?

Integrating new AI models involves creating custom adapters that handle subprocess execution, HTTP requests, output parsing, and configuration. This Skill provides comprehensive guidance for building CLI and HTTP adapters that allow new models to participate in multi-model debates.

What's the difference between CLI and HTTP adapters for AI models?

CLI adapters manage command-line tool execution and parse raw output, while HTTP adapters handle API requests, response parsing, and retry logic. Choose CLI adapters for local tools like Ollama and HTTP adapters for remote AI services.

How do I keep API keys secure when configuring AI model adapters?

Use environment variable substitution in your adapter configuration to keep API keys and secrets out of config files. This approach isolates credentials from version-controlled code while remaining accessible at runtime.

Can I test AI model adapters without making real API calls?

Yes. Implement unit tests using mocking for CLI adapters and VCR cassettes for HTTP interactions. This lets you verify adapter logic and response parsing reliably without external dependencies.

Do I need to understand HTTP clients and subprocess handling to create adapters?

The Skill abstracts these concerns through base adapter classes. You inherit from BaseCLIAdapter or an HTTP base class and implement core methods like output parsing, reducing boilerplate while handling retries and error cases automatically.

What happens after I create an adapter for a new model?

Your new adapter integrates into the deliberation system, allowing the model to receive prompts, execute inference, parse responses, and participate in multi-model reasoning workflows alongside existing integrations.