TABLE OF CONTENTS
NVIDIA H100 GPUs On-Demand
In our latest tutorial, we help you run Nanochat on Hyperstack. From setting up GPUs to fine-tuning your own ChatGPT model for $75, you’ll learn how to use this repo for training a model in a budget.
Want to build your own ChatGPT-like model? Sounds fascinating until you start worrying about costs, hardware limitations and setup headaches. Thanks to AI expert Andrej Karpathy and his open-source repo Nanochat, you can now fine-tune a full conversational model on your own hardware.
While Andrej mentions the training cost of around $100, you can do the same for just $75 with Hyperstack’s high-performance NVIDIA H100 PCIe NVLink GPUs.
In our latest tutorial, we show you exactly how to make it happen, step by step.
Step 1: Accessing Hyperstack
- Go to the Hyperstack website and log in to your account.
- If you're new to Hyperstack, you'll need to create an account and set up your billing information. Check our documentation to get started with Hyperstack.
- Once logged in, you'll be greeted by the Hyperstack dashboard, which provides an overview of your resources and deployments.
Step 2: Deploying a New Virtual Machine
Initiate Deployment
- Look for the "Deploy New Virtual Machine" button on the dashboard.
- Click it to start the deployment process.
Select Hardware Configuration
- In the hardware options, choose the "8xH100 PCIe NVLink" flavour.
Choose the Operating System
- Select the "Ubuntu Server 24.04 LTS R570 CUDA 12.8 with Docker".
Select a keypair
- Select one of the key pairs in your account. Don't have a keypair yet? See our Getting Started tutorial for creating one.
Network Configuration
- Ensure you assign a Public IP to your Virtual machine.
- This allows you to access your VM from the internet, which is crucial for remote management and API access.
Enable SSH Access
- Make sure to enable an SSH connection.
- You'll need this to securely connect and manage your VM.
Review and Deploy
- Double-check all your settings.
- Click the "Deploy" button to launch your virtual machine.
Step 3: Accessing Your VM
Once the initialisation is complete, you can access your VM:
Locate SSH Details
- In the Hyperstack dashboard, find your VM's details.
- Look for the public IP address, which you will need to connect to your VM with SSH.
Connect via SSH
- Open a terminal on your local machine.
- Use the command ssh -i [path_to_ssh_key] [os_username]@[vm_ip_address] (e.g: ssh -i /users/username/downloads/keypair_hyperstack ubuntu@0.0.0.0.0)
- Replace username and ip_address with the details provided by Hyperstack.
Step 4: Download and Prepare the Script
Click here to download the script run_nanochat.sh.
.png?width=1310&height=633&name=image%20(13).png)
Step 5: Start Training
chmod +x ./run_nanochat.sh
screen -L -Logfile nanochat.log -S nanochat bash run_nanochat.sh
Training takes around 4 hours to complete. Since training can take some time, you can safely detach from the session by pressing CTRL+A followed by CTRL+D in your terminal. You can continue to monitor progress anytime by checking the nanochat.log file.
Step 6: Interact with Your Trained Model
After that, you can interact with the model via the terminal using commands like:
python -m scripts.chat_cli -p "Why is the sky blue?"
Or via OpenWebUI with:
python -m scripts.chat_web
If you’d like to use the Web UI, make sure to open the required port to access the interface in your browser.
- Open your VM's firewall settings.
- Allow port 8000 for your IP address (or leave it open to all IPs, though this is less secure and not recommended). For instructions, see here.
- Visit http://[public-ip]:8000 in your browser. For example: http://198.145.126.7:3000
- Set up an admin account for OpenWebUI and save your username and password for future logins. See the attached screenshot.

And voila, you can start talking to your fine-tuned model!
When you're finished with your current workload, you can hibernate your VM to avoid incurring unnecessary costs:
- In the Hyperstack dashboard, locate your Virtual machine.
- Look for a "Hibernate" option.
- Click to hibernate the VM, which will stop billing for compute resources while preserving your setup.
To continue your work without repeating the setup process:
- Return to the Hyperstack dashboard and find your hibernated VM.
- Select the "Resume" or "Start" option.
- Wait a few moments for the VM to become active.
- Reconnect via SSH using the same credentials as before.
New to Hyperstack? Sign up on Hyperstack Today to Get Started.
FAQs
What is Nanochat?
Nanochat is an open-source project by Andrej Karpathy that shows how to train a small ChatGPT-like model from scratch.
What can I do with Nanochat?
You can use Nanochat to train your own conversational AI model, experiment with fine-tuning, and learn the inner workings of transformer-based models, all using just a few hundred lines of code.
How much does it cost to run Nanochat on Hyperstack?
On Hyperstack, you can train and run Nanochat for $75, thanks to affordable on-demand access to high-performance GPUs like the NVIDIA H100 PCIe NVLink.
Which GPUs should I use to train Nanochat?
For best performance, use 8× NVIDIA H100 PCIe NVLink GPUs with Ubuntu on Hyperstack.
Subscribe to Hyperstack!
Enter your email to get updates to your inbox every week
Get Started
Ready to build the next big thing in AI?

