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.3.tar.gz (19.9 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.3-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: londonaicentre_llama_serve-1.1.3.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for londonaicentre_llama_serve-1.1.3.tar.gz
Algorithm Hash digest
SHA256 cd8a39278dfc79c2db795e276be5c248f0bfcc3c98d2eb7a3d5873a72f73480f
MD5 6e9821114758617c7a881472ab3c29d0
BLAKE2b-256 ee90804f9c94fdd74a814fa5588cca8ff0c09fcc8a25494f1d6e7bd107ddba33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: londonaicentre_llama_serve-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for londonaicentre_llama_serve-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 44558a12d39f33bda5019b6764dbce703983353cbd4927eb923f6a4cd8cfa994
MD5 063043c3947e0f47e2c40eb7664bc89e
BLAKE2b-256 b5c650675697a5df936de66d060a62eef2a9c1df8cf8a83197dad82acb86605f

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