Skip to main content

Serve llama models locally

Project description

Llama serve

Serve llama models locally.

  • ⬇️ Downloads weights from S3

  • 📦 Unpacks

  • 🚀 Serves via a local OpenAI-compatible server

Prerequisites

Software

  • Python 3.12

Hardware

  • A GPU with >=24GB VRAM (tested on NVIDIA A30)

Configuration

  • Create a file called .env in the directory where you intend to run this package. Populate it with the details you have been provided with in the following format:
MODEL_NAME=
WEIGHTS_ID=
WEIGHTS_KEY=

Installation

  1. (Recommended) Create a virtual environment and activate it:

    python -m venv .venv
    source .venv/bin/activate
    
  2. Install this package: pip install londonaicentre-llama-serve.

Usage

CLI

  1. Note command line arguments:

    Argument Description
    -v, --verbose Enable debug output (optional)
  2. Start the server as follows: llamaserve [args].

Clients

OpenAI (example)

  1. Interact with the server using the OpenAI client in python:

    from openai import OpenAI
    
    client = OpenAI(
        base_url="http://localhost:5000/v1",
        api_key="blank" 
    )
    
    response = client.chat.completions.create(
        model="<MODEL_NAME>",
        messages=[
            {"role": "system", "content": "You are an LLM named gpt-4o"},
            {"role": "user", "content": "Hello"}
        ]
    )
    
    print(response.choices[0].message.content)
    

License

This project uses a proprietary license (see LICENSE).

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

londonaicentre_llama_serve-1.1.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

londonaicentre_llama_serve-1.1.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file londonaicentre_llama_serve-1.1.2.tar.gz.

File metadata

File hashes

Hashes for londonaicentre_llama_serve-1.1.2.tar.gz
Algorithm Hash digest
SHA256 210ee91b533fa34ecfa9cc8b07c9b9daff4a9d4837a7bb37d768c88075800fac
MD5 a6980f7be3bd99c020780fb53a1c3897
BLAKE2b-256 7364b8b11b43ddbe5f8d472e33f18468f3fe8caa900a70c07f2647fbc47d8e51

See more details on using hashes here.

Provenance

The following attestation bundles were made for londonaicentre_llama_serve-1.1.2.tar.gz:

Publisher: llamaserve-build-and-publish.yml on londonaicentre/schema-llama

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file londonaicentre_llama_serve-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for londonaicentre_llama_serve-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 643a08cafc3aeb742a19530574eac439570470e131980f9b8ec561ee2af65985
MD5 cb04ff105550eab7a980bdc02ea54971
BLAKE2b-256 e7609f2617aaa6a1f7a84296b04a367c0b95128bf513b688627645f4fb78b65d

See more details on using hashes here.

Provenance

The following attestation bundles were made for londonaicentre_llama_serve-1.1.2-py3-none-any.whl:

Publisher: llamaserve-build-and-publish.yml on londonaicentre/schema-llama

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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