Documentation
¶
Index ¶
Constants ¶
const DefaultBaseURL = "http://localhost:11434"
DefaultBaseURL mirrors localembed — Ollama listens on 11434 by default. GETDEBUG_OLLAMA_URL overrides for custom hosts.
const DefaultModel = "qwen2.5-coder:7b"
DefaultModel — Qwen2.5-Coder 7B is the best small-model code-aware option on Ollama today (Apache-2.0, ~4.7GB Q4, JSON-mode-friendly). Users can override with --local-llm-model; popular alternatives: deepseek-r1:7b, llama3.1:8b. We pick a code-specialized default so SAST-style prompts degrade gracefully on weak models.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the minimal HTTP client we need. Stateless aside from the configured base URL + http.Client; safe to reuse across calls.
func New ¶
New returns a client with sane defaults. 10-minute per-request timeout — chat completions on CPU for a non-trivial source file can take 2-5 min on a 7B model; the outer context is still the wall-clock budget.
func (*Client) ChatJSON ¶
ChatJSON sends `messages` to Ollama in JSON-output mode and returns the assistant's content string. Caller json.Unmarshal's it against the expected shape. We do NOT parse here — keeping JSON parsing in the caller lets each prompt own its own response schema.
Temperature defaults to 0.1 (consistent classification, not creative).