GPUStack
Project description
GPUStack
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.
- 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
- Run and chat with the llama3 model:
gpustack chat llama3 "tell me a joke."
- Open
http://myserver
in the browser to access the GPUStack UI. Log in to GPUStack with usernameadmin
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
- Click
Playground
in the navigation menus. Now you can chat with the LLM in the UI playground.
-
Click
API Keys
in the navigation menus, then click theNew API Key
button. -
Fill in the
Name
and click theSave
button. -
Copy the generated API key and save it somewhere safe. Please note that you can only see it once on creation.
-
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",
"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 as the backend and supports large language models in GGUF format. Models from the following sources are supported:
Here are some example models:
- LLaMA
- Mistral 7B
- Mixtral MoE
- DBRX
- Falcon
- Baichuan
- Aquila
- Yi
- StableLM
- Deepseek
- Qwen
- Phi
- Gemma
- Mamba
- Grok-1
OpenAI-Compatible APIs
GPUStack serves the following OpenAI compatible APIs under the /v1-openai
path:
- List models
- Create Chat completions
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",
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
-
Install
python 3.10+
. -
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file gpustack-0.1.1.tar.gz
.
File metadata
- Download URL: gpustack-0.1.1.tar.gz
- Upload date:
- Size: 88.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dea6a0bb71563e4c4cccaf7ff2d7a23664f7041d93a8640d0f81ce3299d0567 |
|
MD5 | daa17d761c52281de27602e4432fb4d9 |
|
BLAKE2b-256 | 8bca7db3712e4c2a48227a64626a937ee8e72a9001b15647a9fd446c701ccd1a |
File details
Details for the file gpustack-0.1.1-py3-none-win_amd64.whl
.
File metadata
- Download URL: gpustack-0.1.1-py3-none-win_amd64.whl
- Upload date:
- Size: 84.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 732cc64f5f85e669d4e823c2cea8a953f1e5350788d8e16637f33537f5fe781f |
|
MD5 | 83235eec3768470be2de3d11ad068189 |
|
BLAKE2b-256 | 001cf85fb8b3b0aee21d0d5886137b3419b0dd7fbdb0e6effef8f9bb0f985b83 |
File details
Details for the file gpustack-0.1.1-py3-none-manylinux2014_x86_64.whl
.
File metadata
- Download URL: gpustack-0.1.1-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 89.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 900675207bd159599377db457e4a2047550784ccbabbb301d6ccb937c35f24a2 |
|
MD5 | c0be56c2cb620f3b4b5b34c0f7c843ee |
|
BLAKE2b-256 | 76f341c1bebb4bd497d84517863a73326340b1db9efb79d80a9b749a6b26271b |
File details
Details for the file gpustack-0.1.1-py3-none-manylinux2014_aarch64.whl
.
File metadata
- Download URL: gpustack-0.1.1-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 89.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c275aa2a85c707720f6378450ea4565bf3cdcefff8f08e35da54ba96a2459ab6 |
|
MD5 | 5ae1173b8693881cb42e643bd9b285af |
|
BLAKE2b-256 | 9353260c07a02315a04d8a035f71f2d483caaa16973a18701258fd6bc97ce279 |
File details
Details for the file gpustack-0.1.1-py3-none-macosx_11_0_universal2.whl
.
File metadata
- Download URL: gpustack-0.1.1-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 14.5 MB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03cd94b7cf2baa3dce7cf3ec703e0317a0cb51b87540fa761a7ba0e830241680 |
|
MD5 | e8367feeba62f755a28563445845a099 |
|
BLAKE2b-256 | 8e149b6bdd2af90b412547c261e98041ef4e147de6c7f6fd246a274d8edad715 |