ractogateway.adapters.ollama_kit

Ollama adapter — local model inference via the Ollama REST API.

Requires the ollama Python package:

pip install ractogateway[ollama]

The Ollama server must be running locally (default: http://localhost:11434). Pull a model first:

ollama pull llama3.2
class ractogateway.adapters.ollama_kit.OllamaLLMKit(model='llama3.2', *, base_url='http://localhost:11434', **kwargs)[source]

Bases: BaseLLMAdapter

Low-level adapter for the Ollama local-inference REST API.

Parameters:
  • model (str) – Model name as reported by ollama list (e.g. "llama3.2", "mistral", "gemma3").

  • base_url (str) – Ollama server base URL. Defaults to http://localhost:11434.

provider: str = 'ollama'
translate_tools(registry)[source]

Convert registry schemas to Ollama function-calling format.

Return type:

list[dict[str, Any]]

run(prompt, user_message, *, history=None, tools=None, temperature=0.0, max_tokens=4096, **kwargs)[source]

Execute a chat request synchronously.

Return type:

LLMResponse

async arun(prompt, user_message, *, history=None, tools=None, temperature=0.0, max_tokens=4096, **kwargs)[source]

Execute a chat request asynchronously.

Return type:

LLMResponse