Add open-source / self-hosted model support#8
Open
mattmorr1 wants to merge 2 commits into
Open
Conversation
| parsed = json.loads(text) | ||
| if isinstance(parsed, dict): | ||
| return parsed | ||
| except (json.JSONDecodeError, TypeError): |
There was a problem hiding this comment.
Pull request overview
Adds a new open_source provider to support self-hosted / open-weight models exposed via OpenAI-compatible Chat Completions endpoints (vLLM/TGI/Ollama/llama.cpp), plus associated configuration and pricing entries.
Changes:
- Introduces
OpenSourceAdapterwith env-driven HTTP configuration and a content-fallback parser for tool calls / final submissions embedded in text. - Registers
open_sourceas a first-class provider and updates config typing to include it. - Adds benchmark + pricing config for several tested open models and introduces unit tests for the fallback parsing behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_providers_open_source.py | Adds unit tests for content-fallback parsing of tool calls and submit_assessment payload recovery. |
| src/socbench/providers/open_source_adapter.py | Implements OpenAI-compatible Chat Completions adapter + parsing/fallback logic for open-source/self-hosted endpoints. |
| src/socbench/providers/base.py | Registers the open_source provider in the adapter factory and known-provider listing. |
| src/socbench/config.py | Extends ProviderName typing to include open_source. |
| config/pricing.yaml | Adds pricing entries under open_source for self-hosted cost attribution. |
| config/benchmark_config.yaml | Adds an open_source provider stanza with defaults and documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- New OpenSourceAdapter for OpenAI-compatible endpoints (vLLM/TGI/Ollama/ llama.cpp), self-configured via OPEN_SOURCE_* env vars and registered as the `open_source` provider. - config + pricing entries for the tested models: Foundation-Sec-8B-Reasoning, Seneca-QwQ-32B, and GLM-5.2. No changes to the agent loop, scoring, prompts, tools, or the hosted-provider adapters — frontier-model benchmark results are unaffected.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
open_sourceprovider.