• This repository has been archived on 26/Jun/2024
  • Stars
    star
    123
  • Rank 288,467 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Large Language Model (LLM) Inference API and Chatbot

Large Language Model (LLM) Inference API and Chatbot ๐Ÿฆ™

project banner

Inference API for LLMs like LLaMA and Falcon powered by Lit-GPT from Lightning AI

pip install llm-inference

Install from main branch

pip install git+https://github.com/aniketmaurya/llm-inference.git@main

# You need to manually install [Lit-GPT](https://github.com/Lightning-AI/lit-gpt) and setup the model weights to use this project.
pip install lit_gpt@git+https://github.com/aniketmaurya/install-lit-gpt.git@install

For Inference

from llm_inference import LLMInference, prepare_weights

path = prepare_weights("EleutherAI/pythia-70m")
model = LLMInference(checkpoint_dir=path)

print(model("New York is located in"))

How to use the Chatbot

chatbot image

from llm_chain import LitGPTConversationChain, LitGPTLLM
from llm_inference import prepare_weights

path = str(prepare_weights("meta-llama/Llama-2-7b-chat-hf"))
llm = LitGPTLLM(checkpoint_dir=path, quantize="bnb.nf4")  # 7GB GPU memory
bot = LitGPTConversationChain.from_llm(llm=llm, prompt=llama2_prompt_template)

print(bot.send("hi, what is the capital of France?"))

Launch Chatbot App

1. Download weights

from llm_inference import prepare_weights
path = prepare_weights("meta-llama/Llama-2-7b-chat-hf")

2. Launch Gradio App

python examples/chatbot/gradio_demo.py

More Repositories

1

tensorflow-fastapi-starter-pack

tensorflow web app starter pack
Python
69
star
2

discord-llm-bot

Fun project: LLM powered RAG Discord Bot that works seamlessly on CPU
Jupyter Notebook
30
star
3

pytorch-gans

PyTorch implementation of GANs (Generative Adversarial Networks). DCGAN, Pix2Pix, CycleGAN, SRGAN
Jupyter Notebook
20
star
4

chatbot-server

ChatBot App built using LangChain and Lightning AI
Python
17
star
5

stable_diffusion_inference

Simple and easy stable diffusion inference with LightningModule on GPU, CPU and MPS (Possibly all devices supported by Lightning).
Python
16
star
6

python-project-template

A template to kick-start your Python project
Makefile
15
star
7

agents

Build Agentic workflows with function calling
Python
15
star
8

aniket-codes

Code/Notebook used for Machine Learning/Deep Learning or Programming Talks
Jupyter Notebook
12
star
9

covid-research

Research on Prognosis and Diagnosis of Covid-19
Jupyter Notebook
8
star
10

chitra-examples

Makefile
5
star
11

LAI-galai

GALACTICA model demo
Python
5
star
12

deep-learning-examples

Collection of code examples and tutorials for PyTorch, Deep Learning, distributed training and large language models (LLMs).
Jupyter Notebook
5
star
13

process-monitor

Monitor system process with Slack notification bot
Python
4
star
14

easy-ai

Train image classification model without (almost) writing any code! ๐Ÿ”ฅ๐ŸŽ‰๐Ÿš€
Python
3
star
15

NLP

Jupyter Notebook
3
star
16

lit-pubsub

Python
3
star
17

bhaikacms

JavaScript
2
star
18

sd-components

Python
2
star
19

aniketmaurya

2
star
20

breast-cancer-detection

Jupyter Notebook
2
star
21

blog

Jupyter Notebook
2
star
22

ml-resources

Machine Learning & Deep Learning Resource links- Paper, blog, code, videos
2
star
23

Kaggle

solutions of Kaggle problems using Python
Jupyter Notebook
1
star
24

lit-kafka

Kafka event based Machine Learning Serving with Lightning App
Python
1
star
25

Web-Dev-Projects

PHP
1
star
26

onnxruntime-nextjs

TypeScript
1
star
27

blog-migration

Jupyter Notebook
1
star
28

45DaysOfLightning

Python
1
star
29

MLFlow-App

Python
1
star
30

soai

KIIT AI Society and SoAI
Jupyter Notebook
1
star
31

dl-in-production

Jupyter Notebook
1
star
32

mdassistai

This repo contains scripts for web app (deployed on Scalingo)
HTML
1
star
33

fastpages-blog

Jupyter Notebook
1
star
34

batching

Python
1
star