Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add one line quickstart #1813

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ server/exllama_kernels/exllama_kernels/hip_func/
*_hip.cuh
server/exllama_kernels/exllama_kernels/hip_buffers.cuh
server/exllama_kernels/exllama_kernels/exllama_ext_hip.cpp

# ignore default docker directory
data/
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ Text Generation Inference (TGI) is a toolkit for deploying and serving Large Lan

## Get Started

### Quick Start ⚡️

The fastest way to get started is to use the quickstart script. This script simplifies the docker and nvidia container toolkit installation process. It also installs the latest version of the text-generation-inference container and runs it with a default model.

```bash
curl --proto '=https' --tlsv1.2 -sSf \
https://raw.githubusercontent.com/huggingface/text-generation-inference/quickstart.sh \
| bash
```
![best practice script review](https://img.shields.io/badge/Best_Practice-yellow) Always review the contents of a script before running it.


### Docker

For a detailed starting guide, please see the [Quick Tour](https://huggingface.co/docs/text-generation-inference/quicktour). The easiest way of getting started is using the official Docker container:
Expand Down
38 changes: 38 additions & 0 deletions quickstart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Check if Docker is installed
if ! command -v docker &> /dev/null; then
# Install Docker based on the OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Ubuntu/Debian-based systems
sudo apt-get update && sudo apt-get install -y docker.io
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not nearly enough to support all the linux variants I'm afraid :)

elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS (using Homebrew)
brew install --cask docker
elif [[ "$OSTYPE" == "msys"* ]]; then
# Windows (using Chocolatey)
choco install docker-desktop
else
echo "Unsupported OS: $OSTYPE"
exit 1
fi
fi

# Install NVIDIA Container Toolkit (only if on Linux)
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Currently, NVIDIA Container Toolkit does not support macOS, so warn the user.
echo "NVIDIA Container Toolkit is not available for macOS."
exit 1
elif [[ "$OSTYPE" == "msys"* ]]; then
# Currently, NVIDIA Container Toolkit does not support Windows directly.
echo "NVIDIA Container Toolkit is not available for Windows. Ensure Docker Desktop WSL 2 backend is enabled."
fi

# Set variables for the Docker container
model="HuggingFaceH4/zephyr-7b-beta"
volume="$PWD/data"

# Run the Docker container in interactive mode to allow CTRL+C to stop the container
docker run -it --gpus all --shm-size 1g -p 8080:80 -v "$volume:/data" ghcr.io/huggingface/text-generation-inference:latest --model-id "$model"