This doc explains how to setup a development environment so you can get started contributing.
Follow the instructions below to set up your development environment.
You must install these tools:
Create Python virtual environments.
$ python -m venv ./venv
Activate the virtual environment
$ source venv/bin/activate
To check out this repository:
- Create your own fork of this repo
- Clone it to your machine:
git clone https://github.com/${YOUR_GITHUB_USERNAME}/llm-inference.git
cd llm-inference
git remote add upstream https://github.com/OpenCSGs/llm-inference.git
Adding the upstream
remote sets you up nicely for regularly
syncing your fork.
Once you reach this point you are ready to do a full build and deploy as described below.
See the guide in Readme to deploy llm-inference
.
Note that you need to start Ray
cluster under llm-inference
directory.
LLMServe allows you to easily add new models by adding a single configuration file. To learn more about how to customize or add new models, see the LLMServe Model Registry.
Then run following command to deploy your model serving.
llm-serve start serving-rest --model=<your_model_yaml_path>
If changes related with CLI llm-serve
, quickly testing with below:
python launch.py ...
For example:
python launch.py --help
Usage: launch.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ list List available model(s) and deployed serving etc. │
│ predict Predict one or several models with one or multiple prompts, optionally read from file, and save the results to a file. │
│ start Start application(s) for LLM serving, API server, experimention, fine-tuning and comparation. │
│ stop Stop application(s) for LLM serving and API server. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
If your changes is related with API Server, need to restart API to active that.
llm-serve stop apiserver
llm-serve start apiserver
If you would like to use the Restful API to manage your model serving, the API serve is needed.
llm-serve start apiserver
Before commit your changes, ensure the pylint test is passed.
$ pylint --rcfile=tests/pylint.conf $(git ls-files '*.py')
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 6.02/10, +3.98)
Welcome send a PR for your changes, or create a issue for question, problem, or feature requests.
The best place to provide feedback about the code is via a Github issue.