Skip to main content

Add your description here

Project description

ollambda

Simple Flask based API server to proxy ollama calls to a more performant backend (such as llama.cpp)

How to Use

Installation

To install ollambda, clone this repository and use pip install .

venv

Venv usage is encouraged, the simplest way to manage this is to use uv:

cd ollambda
uv venv .venv
source .venv/bin/activate
uv pip install .

Configuration

Currently ollambda proxies requests to an upstream llama.cpp server. The address is configured via environment variables or a YAML config file at ~/.ollambda/config.yaml:

Setting Env var Config key Default
Proxy IP OLLAMBDA_PROXY_IP ollambda_proxy_ip 127.0.0.1
Proxy port OLLAMBDA_PROXY_PORT ollambda_proxy_port 8080

Running the server

Start with Gunicorn (included as a dependency):

gunicorn -c gunicorn.conf.py ollambda:app

This spawns one worker per CPU core and binds to 0.0.0.0:5000 by default. Override settings on the command line:

gunicorn ollambda:app -w 4 -b 0.0.0.0:5000

ollama API coverage

Method Endpoint Description Implemented?
POST /api/generate Generate a completion (streaming or non-streaming) N
POST /api/chat Generate a chat completion (with tool calling support) Y
POST /api/create Create a model from another model, GGUF, or safetensors N (no plans)
GET /api/tags List locally available models Y
POST /api/show Show model information (details, modelfile, template, etc.) Y
POST /api/copy Copy a model to a new name N
DELETE /api/delete Delete a model Y
POST /api/pull Download a model from the Ollama library N
POST /api/push Upload a model to a model library N (no plans)
POST /api/embed Generate embeddings from a model Y
GET /api/ps List models currently loaded in memory Y
GET /api/version Retrieve the Ollama server version Y
HEAD /api/blobs/:digest Check if a file blob exists on the server N (no plans)
POST /api/blobs/:digest Push a file blob to the server N (no plans)

[!IMPORTANT] Current "implementation" may not be fully complete and API aligned.

[!NOTE] Source: https://github.com/ollama/ollama/blob/main/docs/api.md

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

ollambda-0.1.1.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

ollambda-0.1.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file ollambda-0.1.1.tar.gz.

File metadata

  • Download URL: ollambda-0.1.1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ollambda-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d5f6aa746ce4e607e7ed0007637350a31ce39db7e470f1ed29d23f826d1bd561
MD5 3fcae16a539af86d5e1ab68bec3c4c8f
BLAKE2b-256 4877342010eeb3584fa644499bfd17c4d877c9b51f94d96357cdcc73da0eb7c6

See more details on using hashes here.

File details

Details for the file ollambda-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ollambda-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ollambda-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dec8ccbeeca89b88a2a3f59acaad4a8f837fdd61eb06fac1173da73858a7c3e
MD5 50cfa27749c09a4a7ab98979d1cea779
BLAKE2b-256 70a27e50b3fce25f4edbb126306c0646964f8107451e41fd3a4de438835d84e4

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