The Six Built-In Providers in ModLens: Complete Configuration Guide

ModLens includes six built-in vision providers—antigravity-cli, gemini-api, openai, anthropic, claude-cli, and kimi-cli—that enable both local subprocess execution and remote API processing for image analysis tasks.

ModLens is an open-source CLI tool for vision-based code assistance that routes image inputs to various AI backends. The six built-in providers in ModLens defined in src/providers/availability.ts offer zero-config defaults for local binaries while supporting major cloud APIs through a unified interface.

Provider Architecture and Registration

All six providers are registered in the PROVIDER_DESCRIPTORS array located in src/providers/availability.ts (lines 23-75). This configuration drives the CLI's provider resolution logic and fail-over behavior.

The resolveProvider() function exported from src/providers/index.ts instantiates the appropriate implementation based on the provider identifier string. Each descriptor specifies whether the provider operates as a subprocess (spawning local binaries) or an API (making HTTP requests to remote endpoints).

The Six Built-In Providers

antigravity-cli (Default)

antigravity-cli is the zero-configuration default provider that invokes the agy binary locally. Defined at lines 38-42 in src/providers/availability.ts, it requires no API keys and serves as the fallback when no specific provider is specified.

gemini-api

gemini-api connects to Google's Gemini vision models. According to the source code at lines 45-48, this provider requires an apiKey in your ModLens configuration but needs no additional parameters for basic usage.

openai (OpenAI-Compatible)

openai supports generic OpenAI-compatible endpoints, including local servers like Ollama or vLLM. Lines 51-55 in src/providers/availability.ts indicate this provider requires three parameters: baseUrl, apiKey, and model.

anthropic

anthropic provides native Claude API access. As implemented in src/providers/anthropicApi.ts and configured at lines 57-60 of the availability descriptor, it requires only an apiKey to authenticate requests to Anthropic's servers.

claude-cli

claude-cli invokes the local claude binary after manual installation. This subprocess provider defined at lines 63-66 executes the Claude Code CLI tool directly on your machine without network API calls.

kimi-cli

kimi-cli similarly invokes the local kimi binary. Configured at lines 69-73 in src/providers/availability.ts, this subprocess provider requires users to install the Kimi Code CLI separately before use.

Using Built-In Providers

Command-Line Interface

Select any built-in provider using the -p or --provider flag:


# Default provider (antigravity-cli)

modlens -i screenshot.png

# Explicit API selection

modlens -i screenshot.png -p gemini-api

# OpenAI-compatible endpoint

modlens -i screenshot.png -p openai

# Local CLI tools

modlens -i screenshot.png -p claude-cli
modlens -i screenshot.png -p kimi-cli

Programmatic Usage

Import the resolver to instantiate providers directly in TypeScript:

import { resolveProvider } from '@/src/providers/index.ts';

// Initialize Gemini provider
const gemini = resolveProvider('gemini-api');
await gemini.execute({ imagePath: 'screenshot.png' });

// Initialize OpenAI-compatible provider
const openai = resolveProvider('openai');
await openai.execute({ imagePath: 'diagram.png' });

Implementation Files

Each provider has a dedicated implementation file in the src/providers/ directory:

Summary

  • ModLens ships with six built-in providers covering both local subprocess execution and cloud API integration.
  • Subprocess providers (antigravity-cli, claude-cli, kimi-cli) execute local binaries and require manual installation of respective CLI tools.
  • API providers (gemini-api, openai, anthropic) require authentication via apiKey, with openai additionally needing baseUrl and model parameters.
  • All providers are defined in src/providers/availability.ts and instantiated through resolveProvider() in src/providers/index.ts.
  • The antigravity-cli provider serves as the zero-config default when no specific provider is specified.

Frequently Asked Questions

What is the default provider in ModLens?

The antigravity-cli provider is the default zero-configuration option that automatically invokes the agy binary. When you run modlens -i image.png without specifying a provider flag, ModLens routes the request to this built-in subprocess provider.

How do I configure API keys for ModLens providers?

API providers require keys in your ModLens configuration file. The gemini-api and anthropic providers need only an apiKey, while the openai provider requires apiKey, baseUrl, and model parameters. Subprocess providers like claude-cli and kimi-cli do not require API keys but need their respective binaries installed locally.

Can I use ModLens with custom OpenAI-compatible endpoints?

Yes. The openai built-in provider supports any OpenAI-compatible API endpoint, including local inference servers like Ollama or vLLM. Configure it by providing the baseUrl pointing to your custom endpoint, along with the appropriate apiKey and model name in your ModLens settings.

Do I need to install additional software to use the CLI providers?

Yes. The claude-cli and kimi-cli subprocess providers require manual installation of the claude and kimi binaries respectively. The antigravity-cli provider requires the agy binary. These are not bundled with ModLens and must be present in your system PATH before the providers can execute successfully.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →