Setup Menus in Admin Panel

  • No products in the cart.

How to Deploy DeepSeek 14B on Google Cloud

🚀 Ultimate Guide: Deploying DeepSeek 14B on Google Cloud (T4 GPU)

This guide provides a detailed step-by-step walkthrough for deploying DeepSeek 14B on Google Cloud VM with a T4 GPU. It includes troubleshooting tips, performance optimizations, and detailed instructions for smooth deployment.

Deploying DeepSeek 14B on Google Cloud with T4 GPU using Python and Flask API.
Step-by-step guide to deploy DeepSeek 14B on Google Cloud.

📌 Step 1: Google Cloud Setup

1.1 Sign Up for Google Cloud & Enable Billing

  1. Go to Google Cloud Console and create an account.
  2. Set Up Billing:
    • Navigate to BillingCreate Billing Account.
    • Attach it to your new project.
    • Google provides free credits for new users.

1.2 Create a New Project

  1. In Google Cloud Console, click Select a ProjectNew Project.
  2. Name it (e.g., deepseek-ai).
  3. Click Create.

1.3 Enable Compute Engine API

  1. Navigate to APIs & ServicesEnable APIs.
  2. Search for Compute Engine API and enable it.

📌 Step 2: Create Google Cloud VM with T4 GPU

2.1 Create a Virtual Machine Instance

  1. Go to Compute EngineVM InstancesCreate Instance.
  2. Configure instance settings:
    • Name: deepseek-t4
    • Region: us-central1
    • Machine Type: n1-standard-8 (8 vCPUs, 30GB RAM)
    • GPU: 1 x NVIDIA T4
    • Boot Disk: Ubuntu 22.04 LTS, 100GB SSD
  3. Click Create and wait for the VM to start.

2.2 Connect to the VM via SSH

gcloud compute ssh deepseek-t4

📌 Step 3: Install Required Dependencies

3.1 Update the System & Install CUDA


sudo apt update && sudo apt upgrade -y
sudo apt install -y nvidia-cuda-toolkit
nvidia-smi
            

3.2 Install Python & Virtual Environment


sudo apt install -y python3 python3-pip python3-venv
python3 -m venv deepseek-env
source deepseek-env/bin/activate
            

3.3 Install Required Python Packages


pip install torch torchvision transformers accelerate flask bitsandbytes
            

📌 Step 4: Load DeepSeek 14B

4.1 Full Python Code for Running the Model


import os
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B"
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")

tokenizer = AutoTokenizer.from_pretrained(model_name, token=huggingface_token)
model = AutoModelForCausalLM.from_pretrained(
    model_name, token=huggingface_token, device_map="auto", torch_dtype=torch.float16
)

prompt = "Explain artificial intelligence."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(
    inputs.input_ids.to(model.device),
    attention_mask=inputs.attention_mask.to(model.device),
    max_length=200,
    pad_token_id=tokenizer.eos_token_id
)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("\nResponse:", response)
            
✅ Your AI chatbot is now live! 🎉 Would you like to secure it with HTTPS or scale it further?

11 responses on "How to Deploy DeepSeek 14B on Google Cloud"

  1. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  2. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  3. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  4. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  5. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  6. Your article helped me a lot, is there any more related content? Thanks!

  7. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  8. I do not even understand how I ended up here, but I assumed this publish used to be great

  9. naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.

  10. Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

  11. I do not even understand how I ended up here, but I assumed this publish used to be great

Leave a Message

Your email address will not be published. Required fields are marked *

top
XEROTECH LTD. All rights reserved.