Skip to main content

Replace ollama with LitServe

Project description

lit-ollama

Build Documentation PyPI - Package Version PyPI - Python Version Docs with MkDocs uv linting: ruff ty prek security: bandit Semantic Versions Copier License

Replace ollama with LitServe

Features

  • LitGPT model support: Load and serve any LitGPT-compatible model using the standard Ollama interface
  • Ollama-compatible API: Full compatibility with the Ollama API specification, allowing you to use any Ollama client without modifications
  • LitServe powered: Built on LitServe for high-performance model serving with auto-batching and GPU acceleration

Installation

With pip:

python -m pip install lit-ollama

With uv:

uv add lit-ollama

How to use it

Run like any other litserve server:

import litserve as ls

from lit_ollama.server.api import LitOllamaAPI

api = LitOllamaAPI("mock")
server = ls.LitServer(
    api,
    accelerator="auto",
    devices="auto",
    callbacks=None,
    middlewares=None,
)
server.run()

Start the server with a specific model:

python server.py --model "meta-llama/Llama-3.2-1B-Instruct"

You can test the server by using the client to interact with it:

python client.py

Docs

uv run mkdocs build -f ./mkdocs.yml -d ./_build/

Update template

copier update --trust -A --vcs-ref=HEAD

Credits

This project was generated with 🚀 python project template.

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

lit_ollama-0.1.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

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

lit_ollama-0.1.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lit_ollama-0.1.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 lit_ollama-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a748037fa788d106136b7d4ee7f864663f5793d9405436d3f0c2749a51990f63
MD5 79942e52b084fa932748728efba2a280
BLAKE2b-256 7fde7b12cba9c214e2887dba7c03bcaedfee8c231ce0ba22f4350596b6e8c659

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lit_ollama-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 lit_ollama-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 073d8945bddbb8c626f06e7601a45e0cb0059080fc4f1ca233b6304a4c5e9289
MD5 02a9e5e1e3c42294281a14bb2aa8e3cd
BLAKE2b-256 060b5af3161454276638ab6b615847e92fc5ad6aed9af7284e07629377ebbfd7

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