# How to Configure OpenAI, Anthropic, and NVIDIA LLM Providers in SkillSpector

> Learn how to configure OpenAI, Anthropic, and NVIDIA LLM providers in SkillSpector. Easily integrate language models using environment variables and provider plugins for seamless AI development.

- Repository: [NVIDIA Corporation/SkillSpector](https://github.com/NVIDIA/SkillSpector)
- Tags: how-to-guide
- Published: 2026-06-15

---

**SkillSpector abstracts LLM access behind a provider plugin system controlled by the `SKILLSPECTOR_PROVIDER` environment variable, implementing `CredentialsProvider` and `ModelMetadataProvider` interfaces to resolve API keys, base URLs, and token budgets from `src/skillspector/providers/`.**

SkillSpector is an open-source skill analysis framework developed by NVIDIA that supports multiple large language model backends without requiring code changes. You can configure different LLM providers (OpenAI, Anthropic, NVIDIA) for SkillSpector by setting environment variables that select a provider class responsible for credential resolution and model metadata registration.

## Provider Architecture and Interfaces

The provider system in `src/skillspector/providers/` abstracts vendor-specific details behind two standardized interfaces. Each concrete provider must implement `CredentialsProvider` to supply authentication details and `ModelMetadataProvider` to expose model-specific limits.

- **`CredentialsProvider`** exposes `resolve_credentials()`, which returns a tuple `(api_key, base_url)` or `None` if the required environment variable is missing.
- **`ModelMetadataProvider`** exposes `get_context_length()`, `get_max_output_tokens()`, and `resolve_model()` to fetch token budgets and default model names from a bundled [`model_registry.yaml`](https://github.com/NVIDIA/SkillSpector/blob/main/model_registry.yaml).

The registry utilities live in [`src/skillspector/providers/registry.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/registry.py), which loads and caches the YAML schema that records `context_length` and `max_output_tokens` for each supported model.

## Provider Selection Logic

The active provider is determined at runtime by the `_select_active_provider()` function in [`src/skillspector/providers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/__init__.py). This function reads the `SKILLSPECTOR_PROVIDER` environment variable and instantiates the corresponding class.

```python

# src/skillspector/providers/__init__.py

def _select_active_provider() -> ModelMetadataProvider:
    name = os.environ.get("SKILLSPECTOR_PROVIDER", "").strip().lower()
    if name == "openai":
        from .openai import OpenAIProvider
        return OpenAIProvider()
    if name == "anthropic":
        from .anthropic import AnthropicProvider
        return AnthropicProvider()
    if name == "nv_build":
        return NvBuildProvider()
    # fallback to nv_build when the optional nv_inference package is absent

    if name in ("nv_inference", ""):
        try:
            from .nv_inference import NvInferenceProvider
            return NvInferenceProvider()
        except ImportError:
            return NvBuildProvider()
    raise ValueError(...)

```

If `SKILLSPECTOR_PROVIDER` is unset, SkillSpector defaults to the **NVIDIA build-time provider** (`nv_build`) after first attempting to import the optional `NvInferenceProvider`.

## Configuring Individual LLM Providers

Each provider implementation lives in its own sub-package and follows the same pattern for credential resolution, differing only in environment variable names and default endpoints.

### OpenAI Configuration

The OpenAI provider is implemented in [`src/skillspector/providers/openai/provider.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/openai/provider.py). It resolves credentials from `OPENAI_API_KEY` and optionally accepts `OPENAI_BASE_URL` for custom endpoints.

```python

# src/skillspector/providers/openai/provider.py

class OpenAIProvider:
    DEFAULT_MODEL = "gpt-5.4"
    SLOT_DEFAULTS: dict[str, str] = {}

    def resolve_credentials(self) -> tuple[str, str | None] | None:
        api_key = os.environ.get("OPENAI_API_KEY", "").strip()
        if not api_key:
            return None
        base_url = os.environ.get("OPENAI_BASE_URL", "").strip() or None
        return api_key, base_url

```

When `base_url` is `None`, SkillSpector uses the standard OpenAI endpoint at `https://api.openai.com/v1`.

### Anthropic Configuration

The Anthropic provider, located in [`src/skillspector/providers/anthropic/provider.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/anthropic/provider.py), requires the `ANTHROPIC_API_KEY` environment variable. It defaults to `claude-opus-4-6` and provides slot-specific overrides where the `meta_analyzer` slot uses `claude-sonnet-4-6`.

The provider points to `https://api.anthropic.com/v1/` as its base URL and implements the same `resolve_credentials()` signature, returning the API key and base URL tuple.

### NVIDIA Build Configuration (Default)

The NVIDIA build provider (`nv_build`) is the default fallback when no provider is specified. Implemented in [`src/skillspector/providers/nv_build/provider.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/nv_build/provider.py), it expects the `NVIDIA_INFERENCE_KEY` environment variable and targets `https://integrate.api.nvidia.com/v1`.

Default model assignments for the NVIDIA provider:
- **Default slot:** `deepseek-ai/deepseek-v4-flash`
- **Meta analyzer slot:** `deepseek-ai/deepseek-v4-pro`

## Credential Resolution Flow

The top-level LLM utilities in [`src/skillspector/llm_utils.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/llm_utils.py) delegate credential resolution to the active provider through the `resolve_provider_credentials()` function exported from [`src/skillspector/providers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/__init__.py).

```python

# src/skillspector/llm_utils.py

def _resolve_llm_credentials() -> tuple[str, str | None]:
    creds = resolve_provider_credentials()   # ← from providers/__init__.py

    if creds is not None:
        return creds
    # fall back to raw OpenAI env vars

    resolved_key = os.environ.get("OPENAI_API_KEY", "").strip()
    ...

```

The resolved `(api_key, base_url)` tuple is then passed to `langchain_openai.ChatOpenAI`, which SkillSpector uses for all LLM-based analyses regardless of the underlying provider.

## Step-by-Step Configuration Guide

1. **Select the provider** by setting `SKILLSPECTOR_PROVIDER` to `openai`, `anthropic`, or `nv_build`.
2. **Export the provider's credential variable:**
   - **OpenAI:** `OPENAI_API_KEY` (and optionally `OPENAI_BASE_URL`)
   - **Anthropic:** `ANTHROPIC_API_KEY`
   - **NVIDIA:** `NVIDIA_INFERENCE_KEY`
3. **(Optional) Override the default model** by setting `SKILLSPECTOR_MODEL` to a specific model name (e.g., `deepseek-ai/deepseek-v4-pro` for the `meta_analyzer` slot).
4. **(Optional) Supply a custom model registry** via `SKILLSPECTOR_MODEL_REGISTRY` pointing to a YAML file that follows the same schema as the bundled [`model_registry.yaml`](https://github.com/NVIDIA/SkillSpector/blob/main/model_registry.yaml).

## Configuration Examples

The following snippets demonstrate complete environment setups for each supported provider.

### OpenAI Provider

```bash
export SKILLSPECTOR_PROVIDER=openai
export OPENAI_API_KEY=sk-your-openai-key

# Optional: specify a custom OpenAI-compatible endpoint

export OPENAI_BASE_URL=https://api.openai.com/v1

skillspector scan path/to/skill

```

### Anthropic Provider

```bash
export SKILLSPECTOR_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-your-anthropic-key

# Override the model for the default slot

export SKILLSPECTOR_MODEL=claude-haiku-1-0

# Or use the slot-specific default for meta_analyzer by setting:

export SKILLSPECTOR_MODEL=claude-sonnet-4-6

skillspector analyze path/to/skill

```

### NVIDIA Build Provider (Default)

```bash
export NVIDIA_INFERENCE_KEY=sk-your-nvidia-key

# SKILLSPECTOR_PROVIDER is optional; nv_build is the fallback

# Optional: point to a custom registry with additional models

export SKILLSPECTOR_MODEL_REGISTRY=/my/custom/models.yaml

skillspector run path/to/skill

```

## Summary

- SkillSpector uses a **provider plugin system** in `src/skillspector/providers/` to support multiple LLM backends without code modifications.
- Set `SKILLSPECTOR_PROVIDER` to `openai`, `anthropic`, or `nv_build` to select the active backend; the system defaults to `nv_build` if unset.
- Each provider implements `resolve_credentials()` to return `(api_key, base_url)` and reads token limits from [`model_registry.yaml`](https://github.com/NVIDIA/SkillSpector/blob/main/model_registry.yaml) via the registry utility.
- The **OpenAI** provider uses `OPENAI_API_KEY` and optionally `OPENAI_BASE_URL`, defaulting to model `gpt-5.4`.
- The **Anthropic** provider uses `ANTHROPIC_API_KEY`, defaulting to `claude-opus-4-6` with slot-specific overrides for `meta_analyzer`.
- The **NVIDIA** provider uses `NVIDIA_INFERENCE_KEY`, defaulting to `deepseek-ai/deepseek-v4-flash` and switching to `deepseek-v4-pro` for the meta analyzer slot.
- Credential resolution flows through [`src/skillspector/llm_utils.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/llm_utils.py), which instantiates `langchain_openai.ChatOpenAI` with the resolved endpoint and key.

## Frequently Asked Questions

### What happens if I don't set `SKILLSPECTOR_PROVIDER`?

If the environment variable is unset, SkillSpector attempts to import `NvInferenceProvider` from the optional `nv_inference` package. If that package is not installed, it falls back to `NvBuildProvider` as the default provider, as implemented in the `_select_active_provider()` function in [`src/skillspector/providers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/__init__.py).

### Can I use a custom OpenAI-compatible endpoint?

Yes. When configuring the OpenAI provider, set the `OPENAI_BASE_URL` environment variable to your custom endpoint URL. The `OpenAIProvider.resolve_credentials()` method in [`src/skillspector/providers/openai/provider.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/openai/provider.py) checks for this variable and passes it to the LangChain client when present.

### How do I specify different models for different analysis slots?

Set the `SKILLSPECTOR_MODEL` environment variable to the specific model name you want to use. The `resolve_model()` method in each provider checks this variable against the `SLOT_DEFAULTS` mapping (for example, `meta_analyzer` maps to `claude-sonnet-4-6` in the Anthropic provider) to determine which model to instantiate for each analysis slot.

### Where does SkillSpector store model token limits?

Token limits are stored in a [`model_registry.yaml`](https://github.com/NVIDIA/SkillSpector/blob/main/model_registry.yaml) file bundled with each provider package. The [`src/skillspector/providers/registry.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/providers/registry.py) module loads this YAML and exposes `get_context_length()` and `get_max_output_tokens()` methods that enforce model-specific budgets during analysis. You can override the registry path by setting `SKILLSPECTOR_MODEL_REGISTRY` to point to your own YAML file following the same schema.