How to Configure OpenAI, Anthropic, and NVIDIA LLM Providers in SkillSpector
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.
CredentialsProviderexposesresolve_credentials(), which returns a tuple(api_key, base_url)orNoneif the required environment variable is missing.ModelMetadataProviderexposesget_context_length(),get_max_output_tokens(), andresolve_model()to fetch token budgets and default model names from a bundledmodel_registry.yaml.
The registry utilities live in 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. This function reads the SKILLSPECTOR_PROVIDER environment variable and instantiates the corresponding class.
# 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. It resolves credentials from OPENAI_API_KEY and optionally accepts OPENAI_BASE_URL for custom endpoints.
# 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, 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, 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 delegate credential resolution to the active provider through the resolve_provider_credentials() function exported from src/skillspector/providers/__init__.py.
# 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
- Select the provider by setting
SKILLSPECTOR_PROVIDERtoopenai,anthropic, ornv_build. - Export the provider's credential variable:
- OpenAI:
OPENAI_API_KEY(and optionallyOPENAI_BASE_URL) - Anthropic:
ANTHROPIC_API_KEY - NVIDIA:
NVIDIA_INFERENCE_KEY
- OpenAI:
- (Optional) Override the default model by setting
SKILLSPECTOR_MODELto a specific model name (e.g.,deepseek-ai/deepseek-v4-profor themeta_analyzerslot). - (Optional) Supply a custom model registry via
SKILLSPECTOR_MODEL_REGISTRYpointing to a YAML file that follows the same schema as the bundledmodel_registry.yaml.
Configuration Examples
The following snippets demonstrate complete environment setups for each supported provider.
OpenAI Provider
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
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)
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_PROVIDERtoopenai,anthropic, ornv_buildto select the active backend; the system defaults tonv_buildif unset. - Each provider implements
resolve_credentials()to return(api_key, base_url)and reads token limits frommodel_registry.yamlvia the registry utility. - The OpenAI provider uses
OPENAI_API_KEYand optionallyOPENAI_BASE_URL, defaulting to modelgpt-5.4. - The Anthropic provider uses
ANTHROPIC_API_KEY, defaulting toclaude-opus-4-6with slot-specific overrides formeta_analyzer. - The NVIDIA provider uses
NVIDIA_INFERENCE_KEY, defaulting todeepseek-ai/deepseek-v4-flashand switching todeepseek-v4-profor the meta analyzer slot. - Credential resolution flows through
src/skillspector/llm_utils.py, which instantiateslangchain_openai.ChatOpenAIwith 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.
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 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 file bundled with each provider package. The 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.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →