🚀 Ollama API Space

This Space provides API endpoints for Ollama model management and inference.

Available Endpoints

GET /api/models

List all available models

POST /api/models/pull

Pull a model from Ollama

Body: {"name": "model_name"}

POST /api/generate

Generate text using a model

Body: {"model": "model_name", "prompt": "your prompt"}

GET /health

Health check endpoint

Usage Examples

You can use this API with OpenWebUI or any other client that supports REST APIs.

cURL Examples

# List models
curl https://your-space-url.hf.space/api/models

# Generate text
curl -X POST https://your-space-url.hf.space/api/generate   -H "Content-Type: application/json"   -d '{"model": "llama2", "prompt": "Hello, how are you?"}'