Skip to main content

GPUStack

Project description


GPUStack


Documentation License WeChat Discord Follow on X(Twitter)


demo

GPUStack is an open-source GPU cluster manager for running large language models(LLMs).

Key Features

  • Supports a Wide Variety of Hardware: Run with different brands of GPUs in Apple MacBooks, Windows PCs, and Linux servers.
  • Scales with Your GPU Inventory: Easily add more GPUs or nodes to scale up your operations.
  • Distributed Inference: Supports both single-node multi-GPU and multi-node inference and serving.
  • Multiple Inference Backends: Supports llama-box (llama.cpp) and vLLM as the inference backends.
  • Lightweight Python Package: Minimal dependencies and operational overhead.
  • OpenAI-compatible APIs: Serve APIs that are compatible with OpenAI standards.
  • User and API key management: Simplified management of users and API keys.
  • GPU metrics monitoring: Monitor GPU performance and utilization in real-time.
  • Token usage and rate metrics: Track token usage and manage rate limits effectively.

Installation

Linux or MacOS

GPUStack provides a script to install it as a service on systemd or launchd based systems. To install GPUStack using this method, just run:

curl -sfL https://get.gpustack.ai | sh -s -

Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace http://myserver and mytoken with your actual server URL and token):

curl -sfL https://get.gpustack.ai | sh -s - --server-url http://myserver --token mytoken

In the default setup, you can run the following to get the token used for adding workers:

cat /var/lib/gpustack/token

Windows

Run PowerShell as administrator (avoid using PowerShell ISE), then run the following command to install GPUStack:

Invoke-Expression (Invoke-WebRequest -Uri "https://get.gpustack.ai" -UseBasicParsing).Content

Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace http://myserver and mytoken with your actual server URL and token):

Invoke-Expression "& { $((Invoke-WebRequest -Uri 'https://get.gpustack.ai' -UseBasicParsing).Content) } --server-url http://myserver --token mytoken"

In the default setup, you can run the following to get the token used for adding workers:

Get-Content -Path "$env:APPDATA\gpustack\token" -Raw

Manual Installation

For manual installation or detailed configurations, refer to the installation docs.

Getting Started

  1. Run and chat with the llama3.2 model:
gpustack chat llama3.2 "tell me a joke."
  1. Open http://myserver in the browser to access the GPUStack UI. Log in to GPUStack with username admin and the default password. You can run the following command to get the password for the default setup:

Linux or MacOS

cat /var/lib/gpustack/initial_admin_password

Windows

Get-Content -Path "$env:APPDATA\gpustack\initial_admin_password" -Raw
  1. Click Playground in the navigation menu. Now you can chat with the LLM in the UI playground.

Playground Screenshot

  1. Click API Keys in the navigation menu, then click the New API Key button.

  2. Fill in the Name and click the Save button.

  3. Copy the generated API key and save it somewhere safe. Please note that you can only see it once on creation.

  4. Now you can use the API key to access the OpenAI-compatible API. For example, use curl as the following:

export GPUSTACK_API_KEY=myapikey
curl http://myserver/v1-openai/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GPUSTACK_API_KEY" \
  -d '{
    "model": "llama3.2",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'

Supported Platforms

  • MacOS
  • Linux
  • Windows

Supported Accelerators

  • Apple Metal
  • NVIDIA CUDA

We plan to support the following accelerators in future releases.

  • AMD ROCm
  • Intel oneAPI
  • MTHREADS MUSA
  • Qualcomm AI Engine

Supported Models

GPUStack uses llama.cpp and vLLM as the backends and supports a wide range of models. Models from the following sources are supported:

  1. Hugging Face

  2. ModelScope

  3. Ollama Library

Example language models:

Example multimodal models:

For full list of supported models, please refer to the supported models section in the inference backends documentation.

OpenAI-Compatible APIs

GPUStack serves the following OpenAI compatible APIs under the /v1-openai path:

  • List Models
  • Create Completions
  • Create Chat Completions
  • Create Embeddings

For example, you can use the official OpenAI Python API library to consume the APIs:

from openai import OpenAI
client = OpenAI(base_url="http://myserver/v1-openai", api_key="myapikey")

completion = client.chat.completions.create(
  model="llama3.2",
  messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ]
)

print(completion.choices[0].message)

GPUStack users can generate their own API keys in the UI.

Documentation

Please see the official docs site for complete documentation.

Build

  1. Install python 3.10+.

  2. Run make build.

You can find the built wheel package in dist directory.

Contributing

Please read the Contributing Guide if you're interested in contributing to GPUStack.

License

Copyright (c) 2024 The GPUStack authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at LICENSE file for details.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpustack-0.3.1.tar.gz (4.0 MB view details)

Uploaded Source

Built Distributions

gpustack-0.3.1-py3-none-win_amd64.whl (7.9 MB view details)

Uploaded Python 3 Windows x86-64

gpustack-0.3.1-py3-none-macosx_11_0_universal2.whl (4.0 MB view details)

Uploaded Python 3 macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file gpustack-0.3.1.tar.gz.

File metadata

  • Download URL: gpustack-0.3.1.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for gpustack-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e30aa149cd9167850c45db713dd151f0c581181f499d917c38ef64a49c6b8b35
MD5 f5c3d39ccd0e4c6145119c2e61411b65
BLAKE2b-256 547918ab23cf75e505942f4b7246a19d516ce8789cea4979511f2f73655af3da

See more details on using hashes here.

File details

Details for the file gpustack-0.3.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: gpustack-0.3.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for gpustack-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8aed81a84cc5956cac8b784fac6001a0d77ca1644c72b31ff57b53c8a24b56db
MD5 1ca5bbf51cd48398887c14a204b99854
BLAKE2b-256 0894e656860bf85f3a18f15752ff31b6caaa0dc82e40e00feb45beab5cf2a765

See more details on using hashes here.

File details

Details for the file gpustack-0.3.1-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gpustack-0.3.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 730d36938d4390490b62c03bc9e1857e179557f1062cc3085bc403491398753c
MD5 48d12bc102e5eb57894efcb472297dd3
BLAKE2b-256 07b2705b0173e2bd9f052d50838b04f0b6389c56b702b75a7a562366a13ebb5e

See more details on using hashes here.

File details

Details for the file gpustack-0.3.1-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for gpustack-0.3.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a288fae02aec5d3432697e091f22df7ced53968a3e71c6b2ade00d69a77e24c9
MD5 bfd5310b3f9411f37a80fa51866758c1
BLAKE2b-256 5dbdabfb1e73ef1b4d809e680b9ab94c8660b6151a928d6cbdf30bd3aad7b76b

See more details on using hashes here.

File details

Details for the file gpustack-0.3.1-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for gpustack-0.3.1-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 324818014fae8be882bed5df12e457ca9edf173edd3f53c7639cfd9f2d541f87
MD5 4718eae79d148dfe5346cdd975b6a2ff
BLAKE2b-256 316d8aa521f565ccafb4595a29786561da3c413f4cf9403f2b9d91b7e8bee75a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page