Skip to main content

FastAPI wrapper for running Ollama locally

Project description

Ollama FastAPI Wrapper

A simple FastAPI wrapper for Ollama models.

Installation

pip install ollama-fastapi

Usage

Run API server

ollama-fastapi

Call API

curl -X POST http://127.0.0.1:8000/generate \
     -H "Content-Type: application/json" \
     -d '{"prompt": "Write a haiku about FastAPI"}'

Use in Python

from ollama_fastapi.client import OllamaClient

ollama = OllamaClient("llama3")
print(ollama.generate("Hello world"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ollama_fastapi-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ollama_fastapi-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file ollama_fastapi-0.1.0.tar.gz.

File metadata

  • Download URL: ollama_fastapi-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ollama_fastapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2a38c9d09663ab88176b75e5d1035b53172c50795bd8e865168b928114d3ca99
MD5 3d2b846b10cb62f6d0a82f8381050f95
BLAKE2b-256 995f81fdcf27505b1ce2a6ad40662604c934232430ce3ab08859ca02f34ce897

See more details on using hashes here.

File details

Details for the file ollama_fastapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ollama_fastapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ollama_fastapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efedcd199a3270f401d78bc7b341c972489655be60ca830569ad852803f5a82f
MD5 dba5623ca4323470394d7bc46c2c48d1
BLAKE2b-256 a4be427428c8235bb372fd56733352dacfff8f0935cd1e0ea827259ed484d638

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page