Load & Run¶
Load models and run completions.
Load a Model¶
The flagship operation — auto-installs if missing:
import modeldock as md
client = md.load("llama3")
client = md.load("llama3", backend="ollama") # explicit backend
Use the Returned Client¶
The client is the native runtime client (e.g., ollama.Client). Use it directly:
# Chat
response = client.chat(
model="llama3",
messages=[{"role": "user", "content": "Hello!"}]
)
# Generate
response = client.generate(model="llama3", prompt="Once upon a time")
Run Completions¶
Use md.run() for quick completions:
# Single completion
result = md.run("llama3", prompt="Explain semver in one sentence.")
print(result.text)
# Interactive REPL (reads stdin until you exit)
md.run("llama3")
Pass Ollama generation options:
Configuration¶
Override the singleton manager before first use:
Or build an explicit, isolated manager:
Next Steps¶
- Cache Management — manage cached artifacts
- Configuration — all config options
- SDK Reference — full API reference