name: pwn-ai-providers-ollama description: Drive PWN::AI::Providers::Ollama from pwn_eval. license: MIT allowed-tools: [pwn, pwn_eval] metadata: bundled: true generated: false preserve: true module: PWN::AI::Providers::Ollama source: pwn/ai/providers/ollama.rb
PWN::AI::Providers::Ollama
Direct client for a local/remote Ollama server REST API. No API key is required for a stock ollama serve (http://127.0.0.1:11434). Paths are native Ollama: GET /api/tags POST /api/chat (native tool_calls, options.num_ctx / num_predict) POST /api/embed POST /v1/chat/completions (OpenAI-compat shim) Spec: https://github.com/ollama/ollama/blob/main/docs/api.md
When to use
Call PWN::AI::Providers::Ollama from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Catalog authentication
Leave ai.ollama.key unset for the stock local server. Direct cloud access
requires ai.ollama.base_uri: https://ollama.com and an Ollama API key in
ai.ollama.key; for a protected proxy use that proxy's root and key instead.
The adapter appends /api/tags and sends the Authorization header only when
a key is configured. It does not run account sign-in, import a local login or accept OAuth grants.
How to call
PWN::AI::Providers::Ollama.get_models.length
Public methods
get_modelsget_modelchat_with_toolschatauthorshelp
References
references/urls.md— URLs from source
Source
pwn/ai/providers/ollama.rb
Verification
get_models takes no arguments. The example counts only the tags returned by
the selected server. An empty catalog does not require OAuth enrollment.
