diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000..8fb235d7 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index 535c916b..19b87f7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,5 @@ nightly-requirements-gpu.txt linguist-generated=true tests/models/__snapshots__/* linguist-generated=true typings/**/*.pyi linguist-generated=true * text=auto eol=lf +# Needed for setuptools-scm-git-archive +.git_archival.txt export-subst diff --git a/.github/actions/release.sh b/.github/actions/release.sh index 38ff6f53..2635898c 100755 --- a/.github/actions/release.sh +++ b/.github/actions/release.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex +set -e # Function to print script usage print_usage() { @@ -61,41 +61,43 @@ fi release_package() { local version="$1" echo "Releasing version ${version}..." - jq --arg release_version "${version}" '.version = $release_version' < package.json > package.json.tmp && mv package.json.tmp package.json - - if [[ $release == 'patch' ]]; then - hatch version "${version}" - fi - towncrier build --yes --version "${version}" - git add CHANGELOG.md changelog.d src/openllm/__about__.py package.json + git add CHANGELOG.md changelog.d package.json git commit -S -sm "infra: prepare for release ${version} [generated] [skip ci]" git push origin main - echo "Releasing tag ${version}..." && git tag -a "v${version}" -sm "Release ${version} [generated by GitHub Actions]" git push origin "v${version}" - echo "Finish releasing version ${version}" } -echo "Cleaning previously built artifacts..." && hatch clean +#get highest tags across all branches, not just the current branch +version="$(git describe --tags "$(git rev-list --tags --max-count=1)")" +VERSION="${version#v}" +# Save the current value of IFS to restore it later +OLD_IFS=$IFS +IFS='.' +# split into array +read -ra VERSION_BITS <<< "$VERSION" +# Restore the original value of IFS +IFS=$OLD_IFS +VNUM1=${VERSION_BITS[0]} +VNUM2=${VERSION_BITS[1]} +VNUM3=${VERSION_BITS[2]} if [[ $release == 'major' ]]; then - hatch version major - CURRENT_VERSION=$(hatch version) - release_package "${CURRENT_VERSION}" + VNUM1=$((VNUM1+1)) + VNUM2=0 + VNUM3=0 elif [[ $release == 'minor' ]]; then - hatch version minor - CURRENT_VERSION="$(hatch version)" - release_package "${CURRENT_VERSION}" + VNUM2=$((VNUM2+1)) + VNUM3=0 else - CURRENT_VERSION=$(hatch version) - - if [[ "$CURRENT_VERSION" =~ \.dev ]]; then - release_package "${CURRENT_VERSION%%.dev*}" - else - echo "Current version is not properly setup as dev version. Aborting..." - exit 1 - fi + VNUM3=$((VNUM3+1)) fi + +echo "Commit count: $(git rev-list --count HEAD)" + +#create new tag +RELEASE_VERSION="$VNUM1.$VNUM2.$VNUM3" +release_package "${RELEASE_VERSION}" diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index 82138c37..01d3171b 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -90,8 +90,11 @@ jobs: run: python -m build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true prepare-next-dev-cycle: needs: + - release - publish-python - binary-distribution runs-on: ubuntu-latest @@ -126,9 +129,19 @@ jobs: GIT_COMMITTER_EMAIL: ${{ steps.import-gpg-key.outputs.email }} run: | git pull --autostash --no-edit --gpg-sign --ff origin main - echo "Bumping version to dev..." && hatch version patch && hatch version dev - jq --arg release_version "$(hatch version)" '.version = $release_version' < package.json > package.json.tmp && mv package.json.tmp package.json - git add src/openllm/__about__.py package.json && git commit -S -sm "infra: bump to dev version of $(hatch version) [generated] [skip ci]" + SEMVER="${{ needs.release.outputs.version }}" + OLD_IFS=$IFS + IFS='.' + read -ra VERSION_BITS <<< "$SEMVER" + IFS=$OLD_IFS + VNUM1=${VERSION_BITS[0]} + VNUM2=${VERSION_BITS[1]} + VNUM3=${VERSION_BITS[2]} + VNUM3=$((VNUM3+1)) + DEV_VERSION="$VNUM1.$VNUM2.$VNUM3.dev0" + echo "Bumping version to ${DEV_VERSION}..." + jq --arg release_version "${DEV_VERSION}" '.version = $release_version' < package.json > package.json.tmp && mv package.json.tmp package.json + git add package.json && git commit -S -sm "infra: bump to dev version of ${DEV_VERSION} [generated] [skip ci]" git push origin HEAD:main binary-distribution: if: github.repository_owner == 'bentoml' @@ -136,6 +149,7 @@ jobs: name: Create binary/wheels distribution uses: bentoml/OpenLLM/.github/workflows/binary-releases.yml@main release-notes: + if: github.repository_owner == 'bentoml' needs: - release - publish-python diff --git a/.gitignore b/.gitignore index 8af78aa2..45dff7a8 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,4 @@ pyapp /target .pdm-python +/src/openllm/_version.py diff --git a/README.md b/README.md index 9ed24697..a5b6bff6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

🦾 OpenLLM

- pypi_status + pypi_status ci @@ -11,6 +11,14 @@ Discord
+ + python_version + + Hatch +
+ + Ruff +

An open platform for operating large language models (LLMs) in production.
Fine-tune, serve, deploy, and monitor any LLMs with ease.

@@ -39,10 +47,14 @@ Images or deploy as serverless endpoint via 🤖️ **Bring your own LLM**: Fine-tune any LLM to suit your needs with `LLM.tuning()`. (Coming soon) + + ![Gif showing OpenLLM Intro](/assets/output.gif)
-## 🏃‍ Getting Started + + +## 🏃 Getting Started To use OpenLLM, you need to have Python 3.8 (or newer) and `pip` installed on your system. We highly recommend using a Virtual Environment to prevent package @@ -105,6 +117,7 @@ openllm query 'Explain to me the difference between "further" and "farther"' Visit `http://localhost:3000/docs.json` for OpenLLM's API specification. +OpenLLM seamlessly supports many models and their variants. Users can also specify different variants of the model to be served, by providing the `--model-id` argument, e.g.: @@ -112,6 +125,10 @@ providing the `--model-id` argument, e.g.: openllm start flan-t5 --model-id google/flan-t5-large ``` +> **Note** that `openllm` also supports all variants of fine-tuning weights, custom model path +> as well as quantized weights for any of the supported models as long as it can be loaded with +> the model architecture. Refer to [supported models](https://github.com/bentoml/OpenLLM/tree/main#-supported-models) section for models' architecture. + Use the `openllm models` command to see the list of models and their variants supported in OpenLLM. @@ -127,8 +144,6 @@ dependencies can be installed with the instructions below: Model Architecture -CPU -GPU Model Ids Installation @@ -136,8 +151,6 @@ dependencies can be installed with the instructions below: chatglm ChatGLMForConditionalGeneration -❌ -✅