How to Configure SkillSpector to Use Local LLMs Like Ollama: A Complete Guide
Configure SkillSpector to use local LLMs like Ollama by setting SKILLSPECTOR_PROVIDER=openai, pointing OPENAI_BASE_URL to your local server endpoint (e.g., http://localhost:11434/v1), and providing any non-empty string for OPENAI_API_KEY while optionally selecting the specific model via SKILLSPECTOR_MODEL.
NVIDIA's SkillSpector analyzes AI skills through LLM-powered semantic analysis. While the tool defaults to cloud-based providers, you can configure SkillSpector to use local LLMs like Ollama through its OpenAI-compatible interface, requiring no code modifications—only environment variable adjustments.
How SkillSpector Routes LLM Requests
SkillSpector communicates with language models through the skillspector.llm_utils helper module. According to the source code in src/skillspector/llm_utils.py, the system first queries the active provider for credentials, then falls back to the generic OpenAI-compatible variables OPENAI_API_KEY and OPENAI_BASE_URL.
The resolver in src/skillspector/providers/__init__.py handles provider selection via the SKILLSPECTOR_PROVIDER environment variable. When configured, it passes these credentials to ChatOpenAI (via llm_utils.get_chat_model()), which routes all LLM requests—including per-file meta-analysis calls—to your specified endpoint. This architecture means any server implementing the OpenAI chat-completion API, including Ollama, works seamlessly.
Step-by-Step Local LLM Configuration
Select the OpenAI-Compatible Provider
Set the provider to openai to enable the OpenAI-compatible wrapper. This provider is a thin abstraction that supplies only the API key and base URL, making it compatible with any local server that mimics the OpenAI API format.
export SKILLSPECTOR_PROVIDER=openai
Configure the API Key and Base URL
Point SkillSpector at your local Ollama instance by setting two critical environment variables. In src/skillspector/providers/openai/provider.py, the system expects OPENAI_API_KEY to contain any non-empty string (Ollama ignores this value but requires it for request validation), and OPENAI_BASE_URL to specify your local endpoint.
export OPENAI_API_KEY=ollama
export OPENAI_BASE_URL=http://localhost:11434/v1
Specify the Local Model Name
Optionally select which model Ollama should use for processing requests. The SKILLSPECTOR_MODEL variable tells SkillSpector which specific model to request from your local server.
export SKILLSPECTOR_MODEL=llama3.1:8b
Complete Configuration Examples
Standard Configuration with OpenAI Provider
This configuration uses the dedicated openai provider for maximum clarity and compatibility:
# 1. Choose the OpenAI-compatible provider
export SKILLSPECTOR_PROVIDER=openai
# 2. Provide a dummy API key (required but ignored by Ollama)
export OPENAI_API_KEY=ollama
# 3. Point to your local Ollama server
export OPENAI_BASE_URL=http://localhost:11434/v1
# 4. Select the model you have pulled in Ollama
export SKILLSPECTOR_MODEL=llama3.1:8b
# 5. Run a scan - LLM requests now hit your local server
skillspector scan ./my-skill/
Using Default Provider with Endpoint Overrides
If you prefer to keep the default nv_build provider but redirect it to a local endpoint, override the environment variables directly:
export SKILLSPECTOR_PROVIDER=nv_build
export OPENAI_API_KEY=ollama
export OPENAI_BASE_URL=http://localhost:11434/v1
export SKILLSPECTOR_MODEL=llama3.1:8b
skillspector scan ./my-skill/
As documented in docs/DEVELOPMENT.md, the OPENAI_BASE_URL variable specifically exists to "Override the OpenAI endpoint (e.g., point at Ollama)."
Disabling LLM Analysis When Needed
If you need to run static analysis only without any LLM calls, use the --no-llm flag to bypass all language model requests:
skillspector scan ./my-skill/ --no-llm
Key Source Files for Reference
Understanding these files helps troubleshoot configuration issues:
src/skillspector/llm_utils.py– Resolves credentials, builds theChatOpenAIinstance, and routes all LLM calls.src/skillspector/providers/openai/provider.py– Demonstrates howOPENAI_API_KEYandOPENAI_BASE_URLtransform into credential pairs for any OpenAI-compatible endpoint.src/skillspector/providers/__init__.py– Handles provider selection logic viaSKILLSPECTOR_PROVIDER.README.md– Contains the quick-start example and the complete table of environment variables.docs/DEVELOPMENT.md– Explains the role ofOPENAI_BASE_URLand lists supported configuration variables.
Summary
- SkillSpector uses an OpenAI-compatible abstraction layer in
llm_utils.pyto connect to language models. - Set
SKILLSPECTOR_PROVIDER=openaito enable local LLM support. - Configure
OPENAI_BASE_URLto point at your Ollama instance (e.g.,http://localhost:11434/v1). - Provide any non-empty value for
OPENAI_API_KEY(required by the client but ignored by Ollama). - Optionally specify the model using
SKILLSPECTOR_MODEL(e.g.,llama3.1:8b). - Use
--no-llmto disable LLM calls entirely for static-only analysis.
Frequently Asked Questions
Do I need to modify SkillSpector code to use Ollama?
No. SkillSpector's provider abstraction in src/skillspector/providers/__init__.py is designed to be generic. You only need to set environment variables before invoking the CLI. The system reads OPENAI_BASE_URL and OPENAI_API_KEY at runtime and passes them to ChatOpenAI, requiring zero code changes.
Why does Ollama require an OpenAI API key if it doesn't use it?
The OPENAI_API_KEY variable is required by the underlying ChatOpenAI client class that SkillSpector instantiates in llm_utils.py. While Ollama ignores the actual key value, the client library requires a non-empty string to initialize the connection. Any placeholder value like "ollama" or "dummy" works.
Can I use other local LLM servers besides Ollama?
Yes. Any server implementing the OpenAI chat-completion API specification works with this configuration. Examples include LM Studio, text-generation-webui, or llama-cpp-python with the OpenAI-compatible server flag. Simply set OPENAI_BASE_URL to the appropriate local endpoint (e.g., http://localhost:1234/v1).
How do I verify SkillSpector is actually connecting to my local server?
Check your Ollama server logs for incoming HTTP requests to the /v1/chat/completions endpoint when running skillspector scan. Additionally, you can set SKILLSPECTOR_PROVIDER=openai and temporarily misconfigure OPENAI_BASE_URL—SkillSpector will fail with a connection error, confirming it attempts to reach your specified local endpoint rather than cloud APIs.
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 →