# `mix req_llm.model_compat`
[🔗](https://github.com/agentjido/req_llm/blob/main/lib/mix/tasks/model_compat.ex#L1)

Validate ReqLLM model coverage using the fixture system.

Models are sourced from LLMDB
Fixture validation state is tracked in priv/supported_models.json (auto-generated).

## Selection Principles

Models are selected using clear precedence: **spec → type → sample**

- **spec**: Pattern over providers/models
  - When **no spec provided** (just `mix mc`): Uses default sets from config (`:test_models` or `:test_embedding_models`)
  - When **spec provided** (e.g., `"anthropic:*"`, `"*:*"`): Uses ALL matching models from registry
- **type**: Filters by operation capability using registry metadata
  - `text` (default): Only text-generation models
  - `embedding`: Only embedding models
  - `image`, `speech`, `transcription`, `rerank`, `ocr`: Specialty operation models
  - `all`: All implemented registry models
- **sample** (optional): Further reduces using `:sample_*_models` config.
  If not configured, falls back to one model per provider.

**Important**:
- Registered providers and catalog models with a shared adapter execution contract are included
- Config lists (`:sample_*_models`) are defaults only, not hard filters
- Explicit specs like `"anthropic:*"` test ALL registry models for that provider

## Usage

    mix req_llm.model_compat                    # Show covered models (passing fixtures)
    mix req_llm.model_compat --sample           # Test sample models from config
    mix req_llm.model_compat --available        # List all registry models (unfiltered)

    ### Test using local fixtures
    mix req_llm.model_compat "anthropic:*"      # ALL Anthropic text models from registry
    mix req_llm.model_compat "openai:gpt-4o"    # Specific model
    mix req_llm.model_compat "*:*"              # All models with an execution route

    ### Test by operation type
    mix req_llm.model_compat "google:*" --type all        # Google models across operations
    mix req_llm.model_compat "google:*" --type embedding  # Google embedding models only
    mix req_llm.model_compat "openai:*" --type image      # OpenAI image models only
    mix req_llm.model_compat "elevenlabs:*" --type speech # ElevenLabs TTS models only
    mix req_llm.model_compat "*:*" --type text            # All implemented text models

    ### Sample subset testing
    mix req_llm.model_compat --sample           # Sample subset (~1 per provider if not configured)
    mix req_llm.model_compat "anthropic:*" --sample --type text

    ### Record new fixtures
    mix req_llm.model_compat "openai:*" --record
    mix req_llm.model_compat "google:*" --type embedding --record

## Flags

    --available        List all models from models.dev API registry (no implementation filter)
    --support-tiers    Annotate --available output with evidence-derived support tiers
    --sample           Further reduce to sample subset (see :sample_* config or fallback)
    --type TYPE        Operation type: text, embedding, image, speech, transcription, rerank, ocr, or all
    --record           Re-record fixtures (live API calls)
    --record-all       Force re-record all fixtures (ignores state)
    --update-state     Update generated compatibility state during replay checks
    --scenario LIST    Comma-separated scenario tags to run (e.g. basic,usage)
    --capability LIST  Comma-separated capability groups to run
    --max-concurrency N
    --debug            Enable verbose fixture debugging

## Notes

- Models need a registered provider or a valid shared adapter execution contract
- Providers without an execution route are skipped with a warning
- The final model list is deterministic and stable

---

*Consult [api-reference.md](api-reference.md) for complete listing*
