shawaz03 commited on
Commit
f0493ea
ยท
verified ยท
1 Parent(s): b7070bf

Update quickstart notebook with dynamic form field

Browse files
Files changed (1) hide show
  1. vibe_coder_quickstart.ipynb +46 -23
vibe_coder_quickstart.ipynb CHANGED
@@ -4,14 +4,14 @@
4
  "cell_type": "markdown",
5
  "metadata": {},
6
  "source": [
7
- "# ๐Ÿš€ VIBE CODER v2.0 MAX โ€” Official Google Colab Quickstart\n",
8
  "\n",
9
- "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/shawaz03/vibe-coder/blob/main/vibe_coder_quickstart.ipynb)\n",
10
  "\n",
11
- "This notebook demonstrates how to run **Vibe Coder v2.0 MAX (7B)** on a **Free Google Colab T4 GPU** using **4-bit NF4 Quantization** (uses only ~5.2 GB VRAM with zero memory warnings).\n",
12
  "\n",
13
- "- **Model**: [`shawaz03/vibe-coder-7b-max`](https://huggingface.co/shawaz03/vibe-coder-7b-max)\n",
14
- "- **Specialization**: Full-Stack React, Next.js 15, TypeScript, Tailwind CSS, Prisma, Zustand, and Anti-AI Aesthetic Directives."
15
  ]
16
  },
17
  {
@@ -27,7 +27,6 @@
27
  "metadata": {},
28
  "outputs": [],
29
  "source": [
30
- "# Install required libraries\n",
31
  "!pip install -q transformers torch accelerate bitsandbytes huggingface_hub"
32
  ]
33
  },
@@ -48,10 +47,8 @@
48
  "from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TextStreamer\n",
49
  "\n",
50
  "MODEL_ID = \"shawaz03/vibe-coder-7b-max\"\n",
 
51
  "\n",
52
- "print(f\"๐Ÿš€ Loading {MODEL_ID} in 4-bit NF4 for Google Colab...\")\n",
53
- "\n",
54
- "# 4-bit configuration (Fits smoothly in 5.2 GB VRAM on Colab T4)\n",
55
  "bnb_config = BitsAndBytesConfig(\n",
56
  " load_in_4bit=True,\n",
57
  " bnb_4bit_quant_type=\"nf4\",\n",
@@ -69,14 +66,14 @@
69
  "model.eval()\n",
70
  "streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)\n",
71
  "\n",
72
- "print(\"\\nโœ… VIBE CODER IS READY TO GENERATE CODE!\")"
73
  ]
74
  },
75
  {
76
  "cell_type": "markdown",
77
  "metadata": {},
78
  "source": [
79
- "### 3. Interactive Code Generator"
80
  ]
81
  },
82
  {
@@ -85,14 +82,19 @@
85
  "metadata": {},
86
  "outputs": [],
87
  "source": [
88
- "# Vibe Coder System Prompt\n",
89
  "VIBE_CODER_SYSTEM_PROMPT = \"\"\"You are Vibe Coder, a world-class principal full-stack software engineer and UI/UX designer.\n",
90
- "ENGINEERING DIRECTIVES:\n",
91
- "1. ZERO PLACEHOLDERS: Never output '// TODO' or incomplete stubs. Every component, hook, and route must be fully written.\n",
92
- "2. MODERN DESIGN SYSTEM: Use Tailwind CSS with dark neutral palettes (bg-neutral-900, border-neutral-800), clean accents (cyan, emerald, violet), and Lucide icons.\n",
93
- "3. TYPE SAFETY: Include full TypeScript interfaces and prop types.\"\"\"\n",
 
 
94
  "\n",
95
  "def ask_vibe_coder(prompt_text, temperature=0.2, max_tokens=1500):\n",
 
 
 
 
96
  " messages = [\n",
97
  " {\"role\": \"system\", \"content\": VIBE_CODER_SYSTEM_PROMPT},\n",
98
  " {\"role\": \"user\", \"content\": prompt_text}\n",
@@ -102,7 +104,7 @@
102
  " inputs = tokenizer(formatted_prompt, return_tensors=\"pt\").to(\"cuda\")\n",
103
  " \n",
104
  " print(\"=\" * 75)\n",
105
- " print(f\"๐Ÿš€ PROMPT: {prompt_text}\")\n",
106
  " print(\"=\" * 75 + \"\\n\")\n",
107
  " \n",
108
  " with torch.no_grad():\n",
@@ -124,17 +126,34 @@
124
  "cell_type": "markdown",
125
  "metadata": {},
126
  "source": [
127
- "### 4. Run Example Prompts"
 
128
  ]
129
  },
130
  {
131
  "cell_type": "code",
132
  "execution_count": null,
133
- "metadata": {},
 
 
134
  "outputs": [],
135
  "source": [
136
- "# Example 1: Full-Stack Component\n",
137
- "ask_vibe_coder(\"Build an interactive pricing card in React with Tailwind CSS, monthly/annual toggle, and checkmark feature list.\")"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  ]
139
  },
140
  {
@@ -143,8 +162,12 @@
143
  "metadata": {},
144
  "outputs": [],
145
  "source": [
146
- "# Example 2: Next.js Server Action\n",
147
- "ask_vibe_coder(\"Write a Next.js Server Action with Zod validation to update user settings with error handling.\")"
 
 
 
 
148
  ]
149
  }
150
  ],
 
4
  "cell_type": "markdown",
5
  "metadata": {},
6
  "source": [
7
+ "# ๐Ÿš€ VIBE CODER v2.0 MAX โ€” Official Google Colab Studio\n",
8
  "\n",
9
+ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/shawaz03/LLM/blob/main/vibe_coder_quickstart.ipynb)\n",
10
  "\n",
11
+ "Run **Vibe Coder v2.0 MAX (7B)** on a **Free Google Colab T4 GPU** in 4-bit NF4 Quantization (5.2 GB VRAM, 0 memory errors).\n",
12
  "\n",
13
+ "- **Hugging Face Model**: [`shawaz03/vibe-coder-7b-max`](https://huggingface.co/shawaz03/vibe-coder-7b-max)\n",
14
+ "- **Specialization**: Autonomous Full-Stack React 19, Next.js 15, TypeScript, Tailwind CSS, Prisma, and Anti-AI Aesthetic Directives."
15
  ]
16
  },
17
  {
 
27
  "metadata": {},
28
  "outputs": [],
29
  "source": [
 
30
  "!pip install -q transformers torch accelerate bitsandbytes huggingface_hub"
31
  ]
32
  },
 
47
  "from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TextStreamer\n",
48
  "\n",
49
  "MODEL_ID = \"shawaz03/vibe-coder-7b-max\"\n",
50
+ "print(f\"๐Ÿš€ Loading {MODEL_ID} in 4-bit NF4...\")\n",
51
  "\n",
 
 
 
52
  "bnb_config = BitsAndBytesConfig(\n",
53
  " load_in_4bit=True,\n",
54
  " bnb_4bit_quant_type=\"nf4\",\n",
 
66
  "model.eval()\n",
67
  "streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)\n",
68
  "\n",
69
+ "print(\"\\nโœ… VIBE CODER IS READY!\")"
70
  ]
71
  },
72
  {
73
  "cell_type": "markdown",
74
  "metadata": {},
75
  "source": [
76
+ "### 3. Vibe Coder Engine Definition"
77
  ]
78
  },
79
  {
 
82
  "metadata": {},
83
  "outputs": [],
84
  "source": [
 
85
  "VIBE_CODER_SYSTEM_PROMPT = \"\"\"You are Vibe Coder, a world-class principal full-stack software engineer and UI/UX designer.\n",
86
+ "ENGINEERING & CODING DIRECTIVES:\n",
87
+ "1. COMPLETE IMPLEMENTATIONS: Never output '// TODO', '/* implement later */', or incomplete stubs. Every component, hook, and route must be fully written.\n",
88
+ "2. NO ARTIFACT STRINGS: Never output template tags, variant numbers (e.g. 'Build Variant #...'), or internal directive texts.\n",
89
+ "3. FULL STATE & INTERACTION: Include real mock data arrays, working toggle logic, and complete TypeScript types.\n",
90
+ "4. MODERN DESIGN SYSTEM: Use Tailwind CSS with dark neutral palettes (bg-neutral-900, border-neutral-800), clean accents (cyan, emerald, violet), and Lucide React icons.\n",
91
+ "5. CLEAN OUTPUT: Output standard, clean TypeScript/React code with 'use client' when state is used.\"\"\"\n",
92
  "\n",
93
  "def ask_vibe_coder(prompt_text, temperature=0.2, max_tokens=1500):\n",
94
+ " if not prompt_text.strip():\n",
95
+ " print(\"โš ๏ธ Please enter a prompt in the box below.\")\n",
96
+ " return\n",
97
+ "\n",
98
  " messages = [\n",
99
  " {\"role\": \"system\", \"content\": VIBE_CODER_SYSTEM_PROMPT},\n",
100
  " {\"role\": \"user\", \"content\": prompt_text}\n",
 
104
  " inputs = tokenizer(formatted_prompt, return_tensors=\"pt\").to(\"cuda\")\n",
105
  " \n",
106
  " print(\"=\" * 75)\n",
107
+ " print(f\"๐Ÿ’ฌ USER PROMPT: {prompt_text}\")\n",
108
  " print(\"=\" * 75 + \"\\n\")\n",
109
  " \n",
110
  " with torch.no_grad():\n",
 
126
  "cell_type": "markdown",
127
  "metadata": {},
128
  "source": [
129
+ "### 4. ๐ŸŽฎ Dynamic Prompt Studio (Interactive Form Box)\n",
130
+ "Type your custom prompt into the box below and click the **Play (Run)** button:"
131
  ]
132
  },
133
  {
134
  "cell_type": "code",
135
  "execution_count": null,
136
+ "metadata": {
137
+ "cellView": "form"
138
+ },
139
  "outputs": [],
140
  "source": [
141
+ "# @title ๐Ÿš€ Vibe Coder Interactive Code Generator { vertical-output: true }\n",
142
+ "# @markdown Enter your custom prompt and configure generation settings:\n",
143
+ "\n",
144
+ "prompt = \"Build an interactive pricing matrix in React with Tailwind CSS, supporting monthly/annual billing toggle, 5 feature bullet checkmarks, and popular badge with zero placeholders.\" # @param {type:\"string\"}\n",
145
+ "temperature = 0.2 # @param {type:\"slider\", min:0.05, max:1.0, step:0.05}\n",
146
+ "max_tokens = 1500 # @param {type:\"slider\", min:256, max:3072, step:128}\n",
147
+ "\n",
148
+ "ask_vibe_coder(prompt, temperature=temperature, max_tokens=max_tokens)"
149
+ ]
150
+ },
151
+ {
152
+ "cell_type": "markdown",
153
+ "metadata": {},
154
+ "source": [
155
+ "### 5. ๐Ÿ’ฌ Continuous Live Chat Loop\n",
156
+ "Run this cell to chat and prompt continuously in real-time:"
157
  ]
158
  },
159
  {
 
162
  "metadata": {},
163
  "outputs": [],
164
  "source": [
165
+ "while True:\n",
166
+ " user_query = input(\"\\n๐Ÿ‘‰ Type any prompt (or 'exit' to quit): \")\n",
167
+ " if not user_query.strip() or user_query.lower() in [\"exit\", \"quit\"]:\n",
168
+ " print(\"Session stopped.\")\n",
169
+ " break\n",
170
+ " ask_vibe_coder(user_query, temperature=0.2)"
171
  ]
172
  }
173
  ],