Skip to content

Releases: llmapp/openai

v0.0.2

28 Aug 08:05
Compare
Choose a tag to compare
v0.0.2 Pre-release
Pre-release

Extract the dist.tar.gz and put it in app/frontend/dist

v0.0.1

05 Aug 02:53
Compare
Choose a tag to compare
v0.0.1 Pre-release
Pre-release

How to use

1. Install dependencies

pip3 install -r requirements.txt

If you have make, you can also run with

make install

2. Set the environment variables, and modify it.

cp .env.example .env
# Modify the `.env` file

3. Download the model weight manually (Optional)

If you have already downloaded the weight files, or you want to manage the model weights in some place, you can specify a MODEL_HUB_PATH in the .env and put the weight files in it. MODEL_HUB_PATH is set to models by default.
OpenAI.mini will first find the model weight in MODEL_HUB_PATH, if it does not exist in it, it will automatically download the weight files from Huggingface by the model name. The MODEL_HUB_PATH directory will be like this

MODEL_HUB_PATH directory layout
┌─hjmao at 573761 in ~/workspace/openai.mini/models
└─○ tree -L 2
.
├── baichuan-inc
│   ├── Baichuan-13B-Base
│   └── Baichuan-13B-Chat
├── intfloat
│   ├── e5-large-v2
│   └── multilingual-e5-large
├── meta-llama
│   ├── Llama-2-13b-chat-hf
│   └── Llama-2-7b-chat-hf
├── openai
│   ├── base.pt
│   ├── large-v2.pt
│   ├── medium.en.pt
│   ├── medium.pt
│   ├── small.pt
│   └── tiny.pt
├── Qwen
│   └── Qwen-7B-Chat
├── stabilityai
│   ├── FreeWilly2
│   ├── stable-diffusion-xl-base-0.9
│   └── stable-diffusion-xl-base-1.0
├── thenlper
│   └── gte-large
└── THUDM
    ├── chatglm2-6b
    └── codegeex2-6b

4. Start server with OpenAI.mini

python3 -m src.api

or

make run

5. Access the OpenAI.mini services

OpenAI.mini have implemented most APIs of the OpenAI platform and also a ChatGPT-like web frontend.
You may access the OpenAI.mini services with the openai libraries or chat with the models in the web frontend.

  • Access as a openai service: You can use openai packages or the Langchain library to access it by setting the openai.api_base="YOUR_OWN_IP:8000/api/v1" and `openai.api_key="none_or_any_other_string". Find more detail examples here.
  • Access as a ChatGPT: You can open it with your web browser with http://YOUR_OWN_IP:8000/index.html?model=MODEL_NAME.