ollama

Documentation Community

Skill notes

When to Use This Skill

This skill should be triggered when: Running local AI models with Ollama Building applications that interact with Ollama's API Implementing chat completions, embeddings, or streaming responses Setting up Ollama authentication or cloud models

2. Simple Text Generation (cURL)

Generate a text response from a prompt:

3. Python Chat with OpenAI Library

Use Ollama with the OpenAI Python library:

4. Vision Model (Image Analysis)

Ask questions about images:

5. Generate Embeddings

Create vector embeddings for text:

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Documentation
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
85 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@rawveg · no license declared
Token usage
Lean
Setup complexity
Manual integration
External API key
Required · Vendor-specific
Operating systems
macOS · Linux · Windows · Docker
Runtime requirements
Python · Docker
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
  • Env read
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.; The upstream repository has not been updated for 220 days and may not match current agent behavior.

Output preview ollama.preview
# 6. Structured Outputs (JSON Schema)

from pydantic import BaseModel
from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")

class FriendInfo(BaseModel):
    name: str
    age: int
    is_available: bool

class FriendList(BaseModel):
    friends: list[FriendInfo]

completion = client.beta.chat.completions.parse(
    temperature=0,
    model="llama3.1:8b",
    messages=[
        {"role": "user", "content": "Return a list of friends in JSON format"}
    ],
    response_format=FriendList,
)

friends_response = completion.choices[0].message
if friends_response.parsed:
    print(friends_response.parsed)

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.