website/blog/2024-03-25-deploy-tabby-in-air-gapped-environment-with-docker/index.md
import noInternetImg from './no-internet.png';
Are you working in an air-gapped environment, and wondering if you can still deploy Tabby? Fear not, because the answer is YES! 🐱📣
Here's how we'll deploy Tabby in an offline environment:
Now, let's dive into the detailed steps:
FROM tabbyml/tabby
ENV TABBY_MODEL_CACHE_ROOT=/models
RUN /opt/tabby/bin/tabby-cpu download --model StarCoder-1B
RUN /opt/tabby/bin/tabby-cpu download --model Nomic-Embed-Text
The TABBY_MODEL_CACHE_ROOT env var sets the directory for saving downloaded models. By setting ENV TABBY_MODEL_CACHE_ROOT=/models, we instruct Tabby to save the downloaded model files in the /models directory within the Docker container during the build process.
docker build -t tabby-offline .
docker save -o tabby-offline.tar tabby-offline
Copy the tabby-offline.tar file to the computer without internet access.
Load the Docker image from the tar file:
docker load -i tabby-offline.tar
docker run -it \
--gpus all -p 8080:8080 -v $HOME/.tabby:/data \
tabby-offline \
serve --model StarCoder-1B --device cuda
Once the container is running successfully, you should see the CLI output similar to the screenshot below:
If you encounter any further issues or have questions, consider join our slack community. Our friendly Tabby enthusiasts are always ready to lend a helping paw and guide you to the answers you seek! 😸💡