GithubHelp home page GithubHelp logo

tivojn / chatglm-openai-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ninehills/chatglm-openai-api

0.0 0.0 0.0 15 KB

Provide OpenAI style API for ChatGLM-6B and Chinese Embeddings Model

Home Page: https://chatglm-openai-api.vercel.app

License: MIT License

Python 100.00%

chatglm-openai-api's Introduction

chatglm-openai-api

Provide OpenAI style API for ChatGLM-6B and Chinese Embeddings Model

Todo

  • Add Embeddings Model
  • support ChatGLM-6B Fine-tuning model
  • support Cloudflare Tunnel with custom domain
  • add Dockerfile

Running in local with ngrok

python3 -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt
# Only support one GPU
CUDA_VISIBLE_DEVICES=0 python main.py --port 8080 --llm_model chatglm-6b-int4 --tunnel ngrok

# if you want to use custom ngrok domain, you need set token and subdomain in config.toml

Running with Embeddings Model

CUDA_VISIBLE_DEVICES=0 python ./main.py  --llm_model chatglm-6b-int4 --embeddings_model text2vec-large-chinese

Running in background

CUDA_VISIBLE_DEVICES=0 nohup python main.py --port 8080 --llm_model chatglm-6b-int4 --tunnel ngrok > nohup.out 2>&1 &

Running with cloudflare tunnel

init cloudflare tunnel

# First, you need to install cloudflare tunnel
# https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/

./cloudflared tunnel login
./cloudflared tunnel create chatglm-openai-api
# chatglm-openai-api.ninehills.tech is custom domain your want to use
./cloudflared tunnel route dns chatglm-openai-api chatglm-openai-api.ninehills.tech

# local debug
# ./cloudflared tunnel --url localhost:8080/. run chatglm-openai-api


CUDA_VISIBLE_DEVICES=0 python main.py --port 8080 --llm_model chatglm-6b-int4 --tunnel cloudflare

chatglm-openai-api's People

Contributors

ninehills 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.