Ollama
Run large language models locally with simple CLI.
Overview
Ollama is a streamlined tool for running and managing large language models locally. It simplifies the process of deploying LLMs on your own machine with an easy-to-use CLI.
Official Website: https://ollama.com Documentation: https://docs.ollama.com
Key Features
- Local Deployment — Run models on your own machine
- Simple CLI — Easy model management
- Model Library — Browse models at ollama.com/library
- OpenAI-Compatible API — Easy integration
- Custom Models — Run any GGUF format model
Quick Start
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Run a model
ollama run model-idUsage Example
from openai import OpenAI
client = OpenAI(
base_url='http://localhost:11434/v1',
api_key='ollama'
)
response = client.chat.completions.create(
model="model-id",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Available Models
Use the Models API to query available models:
curl https://api.yuhuanstudio.com/v1/models?provider=ollama \
-H "Authorization: Bearer YOUR_API_KEY"Models are synced from your Ollama instance. Check the dashboard for current availability.
Official Resources
How is this guide?