Module 1: Logging into Google Cloud Console
Step 1: Sign in to Google Cloud
- Open Google Cloud Console.
- Sign in with your Google account.
- If this is your first time, you might need to create a new project.
Step 2: Create a Google Cloud Project
- Click on the project dropdown (top navigation bar).
- Select New Project.
- Give it a name (e.g.,
MyAIProject
). - Choose a billing account (if applicable) and location.
- Click Create.
Step 3: Enable Required APIs
- Go to APIs & Services > Library.
- Search for and enable:
- Compute Engine API (for virtual machines)
- AI & Machine Learning APIs (like Vertex AI)
- Cloud Storage API (for storing data)
- Go to IAM & Admin and ensure you have the necessary permissions.
Module 2: Running an AI Project Using Ollama
Step 1: Set Up a Google Cloud VM
- Navigate to Compute Engine > VM Instances.
- Click Create Instance.
- Choose a machine type:
n1-standard-2
(for small workloads)n1-highmem-4
(for AI models)
- Select Ubuntu 22.04 as the OS.
- Allow HTTP and HTTPS traffic.
- Click Create.
Step 2: Install Ollama on the VM
- Connect to your VM via SSH:
gcloud compute ssh my-instance-name --zone=us-central1-a
- Install Ollama:
curl -fsSL https://ollama.ai/install.sh | sh
- Start Ollama:
ollama serve &
- Download an AI model:
ollama pull deepseek-r1:1.5b
Step 3: Run AI Inference
- Install dependencies:
pip install langchain langchain-ollama
- Create a Python script (
app.py
):from langchain_core.prompts import ChatPromptTemplate from langchain_ollama.llms import OllamaLLM template = """Question: {question} Answer: Let's think step by step.""" prompt = ChatPromptTemplate.from_template(template) model = OllamaLLM(model="deepseek-r1:1.5b") chain = prompt | model response = chain.invoke({"question": "What is Mixture of Experts?"}) print(response)
- Run the script:
python app.py
Module 3: Creating an Angular Project
Step 1: Install Node.js and Angular CLI
- Install Node.js (LTS version) from Node.js.
- Install Angular CLI:
npm install -g @angular/cli
Step 2: Create a New Angular Project
- Create the project:
ng new my-angular-app --style=scss
- Navigate to the project folder:
cd my-angular-app
Step 3: Add Angular Material
- Install Angular Material:
ng add @angular/material
- Choose a theme (e.g., Indigo Pink).
- Enable typography and animations.
Step 4: Create a Sample Component
- Generate a component:
ng generate component dashboard
- Modify
dashboard.component.html
:<mat-toolbar color="primary">Welcome to My AI Dashboard</mat-toolbar> <button mat-raised-button color="accent">Click Me</button>
Step 5: Run the Angular App
ng serve --open
🚀
No comments:
Post a Comment