How to Configure Different LLM Providers (OpenAI, Anthropic, NVIDIA) for Semantic Analysis in SkillSpector

SkillSpector uses a pluggable provider architecture controlled by the SKILLSPECTOR_PROVIDER environment variable to route semantic analysis requests to OpenAI, Anthropic, or NVIDIA endpoints.

NVIDIA's SkillSpector implements a modular provider system that decouples semantic analysis from specific LLM backends. By configuring different LLM providers for semantic analysis, you can switch between OpenAI's GPT models, Anthropic's Claude family, or NVIDIA's build endpoints without changing application code. The selection logic resides in src/skillspector/providers/__init__.py and activates at runtime based on environment variables.

Provider Selection via Environment Variables

The entry point for all LLM configuration is the SKILLSPECTOR_PROVIDER environment variable. According to the source code in src/skillspector/providers/__init__.py, the _select_active_provider() function (lines 55-78) maps string values to concrete provider classes:

  • openai → OpenAIProvider (api.openai.com)
  • anthropic → AnthropicProvider (api.anthropic.com)
  • nv_build → NvBuildProvider (build.nvidia.com)
  • (unset) → Defaults to NVIDIA provider

OpenAI Configuration

To route semantic analysis through OpenAI, set the provider identifier and API credentials:

export SKILLSPECTOR_PROVIDER=openai
export OPENAI_API_KEY=sk-your-key-here

Optionally override the base URL via OPENAI_BASE_URL if using a proxy or Azure deployment. The concrete implementation lives in src/skillspector/providers/openai/provider.py, which resolves credentials through CredentialsProvider.resolve_credentials() returning a tuple of (api_key, base_url).

Anthropic Configuration

Anthropic integration requires the ANTHROPIC_API_KEY environment variable. Unlike OpenAI, the base URL is hard-coded to https://api.anthropic.com with no override option. Implementation details are in src/skillspector/providers/anthropic/provider.py.

NVIDIA Build Configuration

The NVIDIA provider connects to https://integrate.api.nvidia.com/v1 using the NVIDIA_INFERENCE_KEY credential. This is the default when SKILLSPECTOR_PROVIDER is unset. Source code resides in src/skillspector/providers/nv_build/provider.py.

Credential Resolution and Model Selection

Each provider implements three distinct responsibilities defined in src/skillspector/providers/base.py: credential provision, model metadata resolution, and LangChain chat model instantiation.

How Credentials Are Resolved

The CredentialsProvider.resolve_credentials() method returns (api_key, base_url) or None if authentication is missing. This abstraction allows SkillSpector to normalize access patterns across different cloud providers.

  • OpenAI: Checks OPENAI_API_KEY and optional OPENAI_BASE_URL
  • Anthropic: Requires ANTHROPIC_API_KEY only
  • NVIDIA: Requires NVIDIA_INFERENCE_KEY

Model Resolution Waterfall

The active provider determines which model handles each analysis slot through a three-tier waterfall defined in base.py (lines 31-34):

  1. Global Override: SKILLSPECTOR_MODEL environment variable takes precedence for all slots
  2. Slot-Specific Defaults: Each provider defines a SLOT_DEFAULTS dictionary mapping analyzer roles (e.g., meta_analyzer) to model names
  3. Provider Default: The DEFAULT_MODEL constant in each provider file serves as final fallback

For example, the Anthropic provider defaults to claude-opus-4-6 for standard analysis but switches to claude-sonnet-4-6 for the meta_analyzer slot unless SKILLSPECTOR_MODEL is explicitly set.

Token Budget Management and Model Registry

Every provider ships a model_registry.yaml file containing model-specific token limits. The src/skillspector/providers/registry.py module loads these specifications and exposes:

  • lookup_context_length() - Maximum input tokens
  • lookup_max_output_tokens() - Maximum generation length

These functions enable the semantic analyzer to enforce model-specific constraints before sending requests.

Practical Configuration Examples

Complete environment setups for production scenarios:

OpenAI with Custom Model:

export SKILLSPECTOR_PROVIDER=openai
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://custom.enterprise.endpoint/v1
export SKILLSPECTOR_MODEL=gpt-4o
skillspector scan ./my-skill/

Anthropic with Slot-Aware Defaults:

export SKILLSPECTOR_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...

# Omit SKILLSPECTOR_MODEL to use slot defaults:

# default → claude-opus-4-6

# meta_analyzer → claude-sonnet-4-6

skillspector scan ./my-skill/

NVIDIA Build with Explicit Model:

export SKILLSPECTOR_PROVIDER=nv_build
export NVIDIA_INFERENCE_KEY=sk-nv-...
export SKILLSPECTOR_MODEL=deepseek-ai/deepseek-v4-pro
skillspector scan ./my-skill/

Summary

  • Provider Selection: Set SKILLSPECTOR_PROVIDER to openai, anthropic, or nv_build to switch between backends
  • Authentication: Use OPENAI_API_KEY, ANTHROPIC_API_KEY, or NVIDIA_INFERENCE_KEY respectively; OpenAI supports OPENAI_BASE_URL overrides
  • Model Routing: Control model selection via SKILLSPECTOR_MODEL (global) or rely on per-slot defaults defined in each provider's SLOT_DEFAULTS dictionary
  • Token Limits: The registry system in src/skillspector/providers/registry.py automatically loads model constraints from model_registry.yaml files
  • Source Architecture: Provider implementations live in src/skillspector/providers/<provider>/provider.py following the LLMProvider interface defined in base.py

Frequently Asked Questions

How do I switch between OpenAI and Anthropic without code changes?

Set the SKILLSPECTOR_PROVIDER environment variable to openai or anthropic and ensure the corresponding API key is exported. The selection logic in src/skillspector/providers/__init__.py instantiates the correct provider class at runtime based on this variable.

Can I use different models for different analysis tasks?

Yes, but only through slot-specific defaults defined in the provider's SLOT_DEFAULTS dictionary. If you set SKILLSPECTOR_MODEL, it overrides all slots globally. To use per-slot models, leave the global variable unset and rely on the provider's default configuration (e.g., Anthropic uses claude-opus-4-6 for standard analysis and claude-sonnet-4-6 for meta_analyzer).

Why does Anthropic ignore my base URL environment variable?

The Anthropic provider implementation in src/skillspector/providers/anthropic/provider.py hard-codes the base URL to https://api.anthropic.com. Unlike the OpenAI provider, it does not check for OPENAI_BASE_URL or any custom endpoint override, as the Anthropic API currently operates only from that single endpoint.

What happens if I don't set SKILLSPECTOR_PROVIDER?

When SKILLSPECTOR_PROVIDER is unset, the _select_active_provider() function in src/skillspector/providers/__init__.py defaults to the NVIDIA provider (nv_build or nv_inference). You must still provide NVIDIA_INFERENCE_KEY for authentication.

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 →