// Package ollama implements the go-llm v2 provider interface for Ollama, // targeting Ollama's native /api/chat endpoint. Supports both local Ollama // instances (no API key) and Ollama Cloud (https://ollama.com, requires an // API key sent as a Bearer token). package ollama // New creates a new Ollama provider over the native /api/chat API. An empty // apiKey means local-mode (no Authorization header is sent). A non-empty // apiKey is sent as `Authorization: Bearer ` for Ollama Cloud. // // An empty baseURL defaults to DefaultLocalBaseURL when apiKey is empty, or // DefaultCloudBaseURL when apiKey is set. func New(apiKey, baseURL string) *Provider { if baseURL == "" { if apiKey == "" { baseURL = DefaultLocalBaseURL } else { baseURL = DefaultCloudBaseURL } } return newNative(apiKey, baseURL) }