Skip to content

feat: add Ollama, Azure OpenAI, and generic OpenAI-compatible providers - #179

Merged
rng1995 merged 5 commits into
NVIDIA:mainfrom
mimran-khan:feat/new-providers
Aug 14, 2026
Merged

feat: add Ollama, Azure OpenAI, and generic OpenAI-compatible providers#179
rng1995 merged 5 commits into
NVIDIA:mainfrom
mimran-khan:feat/new-providers

Conversation

@mimran-khan

Copy link
Copy Markdown
Contributor

Summary

Add three new LLM providers to expand SkillSpector beyond cloud-only OpenAI/Anthropic/NVIDIA endpoints:

  • Ollama (SKILLSPECTOR_PROVIDER=ollama) — free local/offline scanning via Ollama's OpenAI-compatible API. No API key required. Supports remote instances via OLLAMA_BASE_URL.
  • Azure OpenAI (SKILLSPECTOR_PROVIDER=azure_openai) — enterprise Azure-hosted deployments using AzureChatOpenAI with deployment-based routing, api-version handling, and dedicated env vars (AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, AZURE_OPENAI_DEPLOYMENT).
  • Generic OpenAI-compatible (SKILLSPECTOR_PROVIDER=openai_compatible) — Groq, Together AI, Mistral, DeepInfra, Fireworks, and any OpenAI-compatible endpoint via SKILLSPECTOR_COMPAT_API_KEY + SKILLSPECTOR_COMPAT_BASE_URL.

Each provider ships its own model_registry.yaml for accurate token budgeting.

Changes

  • src/skillspector/providers/ollama/ — provider, model registry, __init__
  • src/skillspector/providers/azure_openai/ — provider, model registry, __init__
  • src/skillspector/providers/openai_compatible/ — provider, model registry, __init__
  • src/skillspector/providers/__init__.py — register new providers in selector, update error message to mention ollama
  • tests/unit/test_new_providers.py — 35 tests covering credentials, chat model creation, metadata, selection, and error messages

Closes #173, closes #174, closes #175

Test plan

  • All 35 new tests pass (pytest tests/unit/test_new_providers.py -v)
  • All 45 existing provider tests pass (no regressions)
  • Ollama always returns credentials (no API key needed)
  • Ollama custom base URL via OLLAMA_BASE_URL
  • Azure requires both AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT
  • Azure deployment defaults to model name when AZURE_OPENAI_DEPLOYMENT unset
  • Azure API version defaults to 2024-06-01
  • Generic requires both SKILLSPECTOR_COMPAT_API_KEY and SKILLSPECTOR_COMPAT_BASE_URL
  • All three providers' model registries return correct token budgets
  • Unknown provider error message lists all new providers

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Automated SkillSpector Review]

Approved.

Three providers (Ollama, Azure OpenAI, generic OpenAI-compatible) following the established provider pattern. Credential resolution fails closed (Azure and the generic provider return None unless both env vars are set; Ollama supplies the required placeholder key), the Azure key is wrapped in SecretStr, and each ships a bundled model_registry.yaml. 35 tests cover credentials (positive/negative), chat-model creation, metadata, selection, and the updated error message.

Security: the configurable base URLs (OLLAMA_BASE_URL, SKILLSPECTOR_COMPAT_BASE_URL, AZURE_OPENAI_ENDPOINT) are operator-set env vars — the same trust surface as the existing OPENAI_BASE_URL — so no new attacker-controlled SSRF vector from scanned content. Non-blocking: could validate that the base URL is a well-formed http(s) URL to fail earlier on misconfiguration.

mimran-khan added a commit to mimran-khan/SkillSpector that referenced this pull request Jun 25, 2026
Add DEFAULT_MODEL and SLOT_DEFAULTS as ClassVar declarations to
ModelMetadataProvider Protocol so callers no longer need
type: ignore[attr-defined] when accessing provider attributes.

Add validate_base_url() helper that warns on malformed (non-http/https
or missing host) base URLs at model creation time, catching operator
misconfigurations early without raising.

Remove stale type: ignore[attr-defined] from constants.py.

Signed-off-by: mimran-khan <mohammed_imran.khan@outlook.com>
mohgupta-ship-it pushed a commit to mimran-khan/SkillSpector that referenced this pull request Jun 27, 2026
Add DEFAULT_MODEL and SLOT_DEFAULTS as ClassVar declarations to
ModelMetadataProvider Protocol so callers no longer need
type: ignore[attr-defined] when accessing provider attributes.

Add validate_base_url() helper that warns on malformed (non-http/https
or missing host) base URLs at model creation time, catching operator
misconfigurations early without raising.

Remove stale type: ignore[attr-defined] from constants.py.

Signed-off-by: mimran-khan <mohammed_imran.khan@outlook.com>
(cherry picked from commit d0006e1)
mohgupta-ship-it added a commit that referenced this pull request Jun 27, 2026
fix: address non-blocking reviewer nits from #178, #179, and #157
@mimran-khan
mimran-khan force-pushed the feat/new-providers branch from 7f4296a to 46f3a9d Compare July 3, 2026 18:35
rng1995
rng1995 previously approved these changes Jul 9, 2026

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Automated SkillSpector Review]

Re-review: approved. The rewritten head preserves the previously approved Ollama, Azure OpenAI, and generic OpenAI-compatible providers while integrating current main’s Bedrock and agent-CLI options in selection/error text. Credential resolution remains fail-closed where required, secrets use the native/shared constructors, registries remain provider-local, and focused coverage spans selection, credentials, construction, metadata, defaults, and errors.

@rng1995

rng1995 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

@mimran-khan - Please fix CI issues

Ollama provider enables free local/offline LLM scanning via Ollama's
OpenAI-compatible API at localhost:11434. No API key required.

Azure OpenAI provider supports enterprise deployments using
AzureChatOpenAI with deployment-based routing and api-version handling.

Generic OpenAI-compatible provider serves Groq, Together AI, Mistral,
DeepInfra, and other endpoints with dedicated env vars
(SKILLSPECTOR_COMPAT_API_KEY/BASE_URL) and a bundled multi-provider
model registry.

Each provider ships its own model_registry.yaml for accurate token
budgeting.

Closes NVIDIA#173, closes NVIDIA#174, closes NVIDIA#175

Signed-off-by: mimran-khan <mohammed_imran.khan@outlook.com>
@mimran-khan

mimran-khan commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased, added the DCO sign-off and fixed the ruff format issue. Should be green now. @rng1995

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review approved at the current head. The previously reviewed provider behavior remains acceptable and there are no unresolved review threads. CI is green except for the mechanical DCO failure on the unsigned merge commit.

@rng1995
rng1995 force-pushed the feat/new-providers branch from 1e1a92d to ea0cb18 Compare August 14, 2026 20:49
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
@rng1995
rng1995 force-pushed the feat/new-providers branch from ff2dafd to 2d28425 Compare August 14, 2026 21:03
@rng1995
rng1995 merged commit f2f94b4 into NVIDIA:main Aug 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants