Setup
Basic Usage
String Shorthand
Parameters
str
required
Model name (must be pulled first with
ollama pull).str
default:"http://localhost:11434"
Ollama server URL.
float
Sampling temperature.
int
Maximum output tokens.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use local models via Ollama.
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a model
ollama pull llama3
from definable.model.ollama import Ollama
from definable.model.message import Message
model = Ollama(id="llama3")
response = model.invoke(
messages=[Message(role="user", content="Hello!")],
assistant_message=Message(role="assistant", content=""),
)
print(response.content)
agent = Agent(model="ollama/llama3")
ollama pull).from definable.model.ollama import Ollama