Code Monkey home page Code Monkey logo

llm-as-a-service's Introduction

llm-as-a-service

Simple FastAPI service for LLAMA-2 7B chat model.

Current version supports only 7B-chat model.

Tested on a single Nvidia L4 GPU (24GB) at GCP (machine type g2-standard-8).

How to run

Install all dependecies

Run:

poetry install

Download llama-2 model

Download llama-2-7b-chat model accordingly to the instruction from llama repository.

Setup environment variables

export RANK="0"
export WORLD_SIZE="1"
export MASTER_ADDR="0.0.0.0"
export MASTER_PORT="2137"
export NCCL_P2P_DISABLE="1"
export OMP_NUM_THREADS=4  # optional

Start the server

Run the following command:

python laas/main.py

Use server

To learn more about endpoints go to http://0.0.0.0:8080/docs

Tests

pytest

Without loading LLM

To run fast tests (no LLM loaded) run

pytest

With loading LLM

For longer tests run

pytest --runslow

llm-as-a-service's People

Contributors

vuanhtrankcl avatar jacekplocharczyk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.