Skip to content

Add Ollama provider support (agent + judge)#74

Merged
pradeepvrd merged 1 commit into
gke-labs:mainfrom
adrianchung:add-ollama-provider
Jun 18, 2026
Merged

Add Ollama provider support (agent + judge)#74
pradeepvrd merged 1 commit into
gke-labs:mainfrom
adrianchung:add-ollama-provider

Conversation

@adrianchung

@adrianchung adrianchung commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an OpenAI-compatible Ollama integration so the benchmark can run fully locally (agent and/or judge) against Ollama-served models.

Scope

  • pkg/agents/runner/api/llm_adapters.pyOllamaClientAdapter (agent) + OllamaDeepEvalModel (judge)
  • pkg/evaluator/evaluate.pyAGENT_PROVIDER=ollama / JUDGE_PROVIDER=ollama routing; plus SYSTEM_INSTRUCTION_NO_MCP so models emit direct YAML when BENCH_USE_MCP=false (strict instruction-followers previously returned empty responses)
  • requirements.txtopenai client
  • scripts/setup_ollama.sh — install Ollama + pull model
  • tests/test_ollama_adapters.py — unit tests

Adds an OpenAI-compatible Ollama integration so the benchmark can run fully
locally against models served by Ollama:

- pkg/agents/runner/api/llm_adapters.py: OllamaClientAdapter (agent) and
  OllamaDeepEvalModel (judge), backed by Ollama's OpenAI-compatible API.
- pkg/evaluator/evaluate.py: route AGENT_PROVIDER=ollama / JUDGE_PROVIDER=ollama;
  also adds SYSTEM_INSTRUCTION_NO_MCP so models return direct YAML/manifests when
  BENCH_USE_MCP=false (strict instruction-followers previously returned empty).
- requirements.txt: openai client dependency.
- scripts/setup_ollama.sh: install Ollama and pull the model.
- tests/test_ollama_adapters.py: unit tests for the adapter and judge model.
return anthropic_messages


class OllamaClientAdapter(LLMClient):

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.

Note: This will go thorugh some extensive refactoring in near future. But ok to merge for now.

@pradeepvrd pradeepvrd merged commit 39cb71f into gke-labs:main Jun 18, 2026
6 checks passed
pradeepvrd added a commit to pradeepvrd/devops-bench that referenced this pull request Jun 18, 2026
Ports the merged Ollama support (gke-labs#74) onto the new devops_bench/models
structure. OllamaClientAdapter talks to an Ollama server via the openai
client's OpenAI-compatible endpoint (OLLAMA_BASE_URL), self-registers under
the canonical 'ollama' key, and defers the openai import so a missing SDK
surfaces as MissingDependencyError at construction.

- new 'ollama' optional-dependency extra (openai>=1.0.0), added to 'all'
- get_model resolves 'ollama' via its existing dynamic per-key import
- unit tests for construction, tool formatting, call/text extraction, and
  message conversion

Tests: 172 passed; ruff clean.
pradeepvrd added a commit to pradeepvrd/devops-bench that referenced this pull request Jun 23, 2026
Ports the merged Ollama support (gke-labs#74) onto the new devops_bench/models
structure. OllamaClientAdapter talks to an Ollama server via the openai
client's OpenAI-compatible endpoint (OLLAMA_BASE_URL), self-registers under
the canonical 'ollama' key, and defers the openai import so a missing SDK
surfaces as MissingDependencyError at construction.

- new 'ollama' optional-dependency extra (openai>=1.0.0), added to 'all'
- get_model resolves 'ollama' via its existing dynamic per-key import
- unit tests for construction, tool formatting, call/text extraction, and
  message conversion

Tests: 172 passed; ruff clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants