nzgnzg73 commited on
Commit
dd1221d
·
verified ·
1 Parent(s): 301cff3

Upload 3 files

Browse files
Install tutorial.txt ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+
4
+
5
+ llama-server.exe --n-gpu-layers 0 --ctx-size 4096 -m "C:\Users\........"
6
+
7
+
8
+
9
+ Example command:
10
+
11
+ llama-server.exe --n-gpu-layers 0 --ctx-size 4096 -m "C:\Users\Mr_Nomi\Downloads\gemma-3-12b-it-Q4_K_S.gguf"
12
+
13
+
14
+
15
+
16
+
17
+ video:- https://youtu.be/FLp-_Ln8Wtg?si=txPUQqPgNyCQwYUd
18
+
19
+
20
+ github:- https://github.com/ggml-org/llama.cpp/releases
21
+
22
+
23
+ Model:- https://huggingface.co/models?num_parameters=min:0,max:1B&library=gguf&sort=trending
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+ Cpu Only
33
+
34
+
35
+ llama-server.exe --n-gpu-layers 0 --ctx-size 4096 -m "C:\Users\Mr_Nomi\Downloads\gemma-3-12b-it-Q4_K_S.gguf"
36
+
37
+
38
+
39
+ Gpu Only/Cuda Olny
40
+
41
+ llama-server.exe --n-gpu-layers 999 --ctx-size 4096 -m "C:\Users\Mr_Nomi\Downloads\gemma-3-12b-it-Q4_K_S.gguf"
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ 💻 Llama.cpp Setup Guide for Windows (English)
55
+ This guide provides the exact steps to download the correct Llama.cpp binaries for Windows and run an LLM (Large Language Model) locally using a command prompt.
56
+ Part 1: Download Llama.cpp Windows Binaries
57
+ * Search & Navigate: Open your web browser and search for the Llama.cpp GitHub page, or use the direct link below:
58
+ Link: https://github.com/ggerganov/llama.cpp/releases
59
+ * Select the Latest Release: On the right sidebar, click on the latest available release (e.g., a tag like b7028).
60
+ * Download the Windows Package: Scroll down to the Assets section. You must download the file specifically built for Windows 64-bit (x64) that supports your hardware.
61
+ * For CPU-ONLY Use (Recommended for maximum compatibility): Download the file containing cpu-win-x64 in its name.
62
+ * Example File Name: llama-bXXXX-bin-cpu-win-x64.zip
63
+ * For NVIDIA GPU (CUDA) Use: Download the file containing cuda-XX.X-x64 in its name.
64
+ * Example File Name: llama-bXXXX-bin-win-cuda-12.4-x64.zip
65
+ * Extract the Files: Once downloaded, Extract the entire contents of the .zip file into a new, easily accessible folder (e.g., E:\llama-setup). This will create a build folder containing the necessary bin subdirectory.
66
+ Part 2: Download the LLM Model (GGUF Format)
67
+ * Download the Model File: You need an LLM model in the GGUF format. We will use the Gemma 2B model as an example due to its small size and efficiency.
68
+ Model Link (Gemma 2B Q4_K_S GGUF): https://huggingface.co/lmstudio-community/gemma-2b-it-GGUF/blob/main/gemma-2b-it-Q4_K_S.gguf
69
+ * Save the Model: Download the GGUF file and place it in a simple location, like your Downloads folder:
70
+ * Model Path Example: C:\Users\YourName\Downloads\gemma-2b-it-Q4_K_S.gguf
71
+ Part 3: Run the Model (Command Line)
72
+ * Open the Bin Folder: Navigate to the folder where the executable files are located: E:\llama-setup\build\bin.
73
+ * Open Command Prompt: Right-click in an empty space within the bin folder and select Open in Terminal or Open PowerShell window here.
74
+ * Execute the Command: Now, run the llama-server.exe file, specifying the correct options and the path to your downloaded model (-m).
75
+
76
+
77
+
78
+
79
+ * If you downloaded the CPU-ONLY version (Recommended):
80
+ llama-server.exe --n-gpu-layers 0 --ctx-size 4096 -m "C:\Users\YourName\Downloads\gemma-2b-it-Q4_K_S.gguf"
81
+
82
+
83
+
84
+
85
+
86
+ * If you downloaded the CUDA (GPU) version:
87
+
88
+
89
+ llama-server.exe --n-gpu-layers 80 --ctx-size 4096 -m "C:\Users\YourName\Downloads\gemma-2b-it-Q4_K_S.gguf"
90
+
91
+
92
+
93
+ > Note: Replace "C:\Users\YourName\Downloads\gemma-2b-it-Q4_K_S.gguf" with the actual path where you saved your model.
94
+ >
95
+
96
+ * Access the Web Interface: Once the server starts running, it will display a local IP address (e.g., http://127.0.0.1:8080). Copy this address and paste it into your web browser to start chatting with the model!
97
+
98
+
99
+
100
+
101
+
102
+
103
+ 💻 ونڈوز کے لیے Llama.cpp سیٹ اپ گائیڈ (اردو)
104
+ یہ گائیڈ آپ کو ونڈوز پر Llama.cpp کی درست باائنریز ڈاؤن لوڈ کرنے اور کمانڈ پرامپٹ کے ذریعے ایک LLM (لارج لینگویج ماڈل) کو لوکل مشین پر چلانے کا صحیح طریقہ بتائے گا۔
105
+ حصہ 1: Llama.cpp کی ونڈوز باائنریز ڈاؤن لوڈ کرنا
106
+ * سرچ اور وزٹ کریں: اپنا ویب براؤزر کھولیں اور Llama.cpp کے گٹ ہب پیج کو سرچ کریں، یا نیچے دیا گیا براہ راست لنک استعمال کریں:
107
+ لنک: https://github.com/ggerganov/llama.cpp/releases
108
+ * تازہ ترین ریلیز منتخب کریں: دائیں جانب موجود پینل میں، سب سے تازہ ترین دستیاب ریلیز پر کلک کریں۔
109
+ * ونڈوز پیکج ڈاؤن لوڈ کریں: Assets سیکشن تک نیچے سکرول کریں۔ آپ کو خاص طور پر ونڈوز 64-بٹ (x64) کے لیے بنائی گئی فائل ڈاؤن لوڈ کرنی ہے جو آپ کے ہارڈویئر کو سپورٹ کرے۔
110
+ * صرف CPU استعمال کے لیے (زیادہ مطابقت کے لیے تجویز کردہ): اس فائل کو ڈاؤن لو�� کریں جس کے نام میں cpu-win-x64 شامل ہو۔
111
+ * مثال فائل کا نام: llama-bXXXX-bin-cpu-win-x64.zip
112
+ * NVIDIA GPU (CUDA) استعمال کے لیے: اس فائل کو ڈاؤن لوڈ کریں جس کے نام میں cuda-XX.X-x64 شامل ہو۔
113
+ * مثال فائل کا نام: llama-bXXXX-bin-win-cuda-12.4-x64.zip
114
+ * فائلز کو ایکسٹریکٹ کریں: ڈاؤن لوڈ ہونے کے بعد، پوری .zip فائل کو ایک نئی، آسانی سے قابل رسائی جگہ پر ایکسٹریکٹ کر لیں (مثلاً، E:\llama-setup)۔ اس سے ایک build فولڈر بنے گا جس میں ضروری bin سب ڈائریکٹری موجود ہو گی۔
115
+ حصہ 2: LLM ماڈل ڈاؤن لوڈ کرنا (GGUF فارمیٹ)
116
+ * ماڈل فائل ڈاؤن لوڈ کریں: آپ کو GGUF فارمیٹ میں ایک LLM ماڈل درکار ہے۔ ہم چھوٹی سائز اور افادیت کی وجہ سے Gemma 2B ماڈل کو مثال کے طور پر استعمال کریں گے۔
117
+ ماڈل کا لنک (Gemma 2B Q4_K_S GGUF): https://huggingface.co/lmstudio-community/gemma-2b-it-GGUF/blob/main/gemma-2b-it-Q4_K_S.gguf
118
+ * ماڈل محفوظ کریں: GGUF فائل ڈاؤن لوڈ کریں اور اسے کسی سادہ مقام پر رکھیں، جیسے کہ آپ کا Downloads فولڈر:
119
+ * ماڈل پاتھ کی مثال: C:\Users\آپ کا نام\Downloads\gemma-2b-it-Q4_K_S.gguf
120
+ حصہ 3: ماڈل چلانا (کمانڈ لائن)
121
+ * Bin فولڈر کھولیں: اس فولڈر میں جائیں جہاں آپ کی llama-server.exe فائل موجود ہے: E:\llama-setup\build\bin۔
122
+ * کمانڈ پرامپٹ کھولیں: bin فولڈر کے اندر خالی جگہ پر رائٹ کلک کریں اور Open in Terminal یا Open PowerShell window here کو منتخب کریں۔
123
+ * کمانڈ ایگزیکیوٹ کریں: اب، llama-server.exe فائل کو چلائیں، اور صحیح آپشنز اور ماڈل کا پاتھ (-m) بتائیں۔
124
+ * اگر آپ نے صرف CPU ورژن ڈاؤن لوڈ کیا ہے (تجویز کردہ):
125
+ llama-server.exe --n-gpu-layers 0 --ctx-size 4096 -m "C:\Users\آپ کا نام\Downloads\gemma-2b-it-Q4_K_S.gguf"
126
+
127
+ * اگر آپ نے CUDA (GPU) ورژن ڈاؤن لوڈ کیا ہے:
128
+ llama-server.exe --n-gpu-layers 80 --ctx-size 4096 -m "C:\Users\آپ کا نام\Downloads\gemma-2b-it-Q4_K_S.gguf"
129
+
130
+ > نوٹ: "C:\Users\آپ کا نام\Downloads\gemma-2b-it-Q4_K_S.gguf" کی جگہ وہ اصل پاتھ استعمال کریں جہاں آپ نے اپنا ماڈل محفوظ کیا ہے۔
131
+ >
132
+ * ویب انٹرفیس تک رسائی: سرور کے چلنا شروع ہوتے ہی، یہ ایک لوکل IP ایڈریس ظاہر کرے گا (مثلاً: http://127.0.0.1:8080)۔ اس ایڈریس کو کاپی کریں اور اپنے ویب براؤزر میں پیسٹ کریں تاکہ ماڈل کے ساتھ چیٹنگ شروع کی جا سکے۔
llama_cpp_WebUI.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698bf6499849700d3ba070937f5b5d5eab3927a7bb2b2262017fd4ffc8df39e3
3
+ size 182568926
run_bat Edit tutorial.txt ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ chatgpt:= https://chatgpt.com/share/69141b4b-3448-800e-87ef-fb83c51228e9
2
+
3
+ https://chatgpt.com/share/69141b4b-3448-800e-87ef-fb83c51228e9
4
+
5
+
6
+
7
+
8
+
9
+ Tutorial: How to Edit Run.bat for Llama.cpp Local Server
10
+
11
+ Step 1: Locate the Run.bat File
12
+
13
+ Go to the folder where you downloaded Llama.cpp.
14
+
15
+ Example path:
16
+
17
+
18
+ D:\Flie\llama.cpp
19
+
20
+ You will see Run.bat inside this folder.
21
+
22
+
23
+ Step 2: Open Run.bat for Editing
24
+
25
+ Right-click Run.bat → Choose Edit or Open with Notepad.
26
+
27
+ This will open the batch file and you can see the code inside.
28
+
29
+
30
+ Step 3: Edit the Base Directory
31
+
32
+ Look for the line that defines the BASE_DIR.
33
+
34
+ Example:
35
+
36
+
37
+ SET BASE_DIR=D:\Flie\llama.cpp
38
+
39
+ Replace D:\Flie\llama.cpp with your own Llama.cpp folder location if it’s different.
40
+
41
+
42
+ Step 4: Check Models Folder
43
+
44
+ Make sure you have a models folder inside your base folder.
45
+
46
+ Place all your .gguf model files inside this folder.
47
+
48
+ The batch file line should look like:
49
+
50
+
51
+ SET MODELS_DIR=%BASE_DIR%\models
52
+
53
+ Step 5: Save the File
54
+
55
+ After editing the path, click File → Save in Notepad.
56
+
57
+ Close Notepad.
58
+
59
+
60
+ Step 6: Run the File
61
+
62
+ Double-click Run.bat.
63
+
64
+ You will see a list of models with numbers.
65
+
66
+ Type the number of the model you want to run and press Enter.
67
+
68
+ The server will start and automatically open the browser at:
69
+
70
+
71
+ http://127.0.0.1:8080/
72
+
73
+
74
+ ---
75
+
76
+ Step 7: Optional GPU/CPU Settings
77
+
78
+ The batch file uses GPU by default:
79
+
80
+
81
+ --n-gpu-layers 999
82
+
83
+ If you want CPU only, edit the line in Run.bat like this:
84
+
85
+
86
+ --n-gpu-layers 0
87
+
88
+
89
+ ---
90
+
91
+ ✅ Now your Run.bat is ready and will always show your models and run the server correctly.
92
+
93
+
94
+ ---
95
+
96
+ ٹیوٹوریل: Run.bat کو ایڈٹ کرنا اور ماڈل فولڈر لوکیشن دینا (اردو)
97
+
98
+ Step 1: Run.bat فائل تلاش کریں
99
+
100
+ وہ فولڈر کھولیں جہاں آپ نے Llama.cpp رکھا ہوا ہے۔
101
+
102
+ مثال:
103
+
104
+
105
+ D:\Flie\llama.cpp
106
+
107
+ یہاں آپ کو Run.bat نظر آئے گا۔
108
+
109
+
110
+ Step 2: Run.bat کھولیں
111
+
112
+ Run.bat پر Right-click → Edit یا Open with Notepad کریں۔
113
+
114
+ Notepad میں فائل کھل جائے گی اور آپ کو کوڈ نظر آئے گا۔
115
+
116
+
117
+ Step 3: Base Directory ایڈٹ کریں
118
+
119
+ وہ لائن تلاش کریں جو BASE_DIR define کرتی ہے۔
120
+
121
+ مثال:
122
+
123
+
124
+ SET BASE_DIR=D:\Flie\llama.cpp
125
+
126
+ اگر آپ نے Llama.cpp کسی اور فولڈر میں رکھا ہے تو اس کا path یہاں دیں۔
127
+
128
+
129
+ Step 4: Models فولڈر چیک کریں
130
+
131
+ یقین کریں کہ base folder میں models فولڈر موجود ہے۔
132
+
133
+ اپنے تمام .gguf ماڈلز اس میں رکھیں۔
134
+
135
+ Batch فائل میں یہ لائن اس طرح ہونی چاہیے:
136
+
137
+
138
+ SET MODELS_DIR=%BASE_DIR%\models
139
+
140
+ Step 5: فائل Save کریں
141
+
142
+ Notepad میں File → Save کریں۔
143
+
144
+ Notepad بند کر دیں۔
145
+
146
+
147
+ Step 6: Run کریں
148
+
149
+ Run.bat پر Double-click کریں۔
150
+
151
+ ماڈلز کی لسٹ نمبر کے ساتھ دکھائی دے گی۔
152
+
153
+ جس ماڈل کو چلانا ہے اس کا نمبر لکھیں اور Enter دبائیں۔
154
+
155
+ Server start ہو جائے گا اور browser خود بخود کھلے گا:
156
+
157
+
158
+ http://127.0.0.1:8080/
159
+
160
+
161
+ ---
162
+
163
+ Step 7: GPU یا CPU موڈ
164
+
165
+ Default GPU استعمال ہوتا ہے:
166
+
167
+
168
+ --n-gpu-layers 999
169
+
170
+ اگر CPU پر چلانا ہو تو 0 لکھیں:
171
+
172
+
173
+ --n-gpu-layers 0
174
+
175
+
176
+ ---
177
+
178
+ ✅ اب آپ کا Run.bat بالکل تیار ہے۔
179
+ یہ ہمیشہ ماڈل لسٹ دکھائے گا اور server صحیح طریقے سے چلائے گا۔
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ run.bat
204
+
205
+
206
+
207
+
208
+ @echo off
209
+ Title 🦙 Llama.cpp Local Server - GPU + Model Selector + Auto Chrome
210
+
211
+ REM --- PATH SETTINGS ---
212
+ SET BASE_DIR=D:\Flie\llama.cpp
213
+ SET MODELS_DIR=%BASE_DIR%\models
214
+ SET SERVER_EXE=%BASE_DIR%\llama-server.exe
215
+
216
+ REM --- SERVER SETTINGS ---
217
+ SET HOST_IP=0.0.0.0
218
+ SET PORT=8080
219
+ SET GPU_LAYERS=999
220
+ SET CONTEXT_SIZE=4096
221
+
222
+ echo ============================================
223
+ echo 🦙 Llama.cpp Local Server - Model Selector
224
+ echo ============================================
225
+ echo.
226
+ echo Available Models in: %MODELS_DIR%
227
+ echo.
228
+
229
+ REM --- LIST ALL MODELS ---
230
+ SETLOCAL ENABLEDELAYEDEXPANSION
231
+ SET COUNT=0
232
+ for %%f in ("%MODELS_DIR%\*.gguf") do (
233
+ SET /A COUNT+=1
234
+ echo !COUNT!. %%~nxf
235
+ SET "MODEL[!COUNT!]=%%~nxf"
236
+ )
237
+
238
+ echo.
239
+ set /p choice=Enter the model number to load:
240
+
241
+ IF "%choice%"=="" (
242
+ echo No selection made. Exiting...
243
+ pause
244
+ exit /b
245
+ )
246
+
247
+ SET SELECTED_MODEL=!MODEL[%choice%]!
248
+ echo.
249
+ echo ✅ Selected model: %SELECTED_MODEL%
250
+ echo ---------------------------------------------
251
+
252
+ SET MODEL_PATH="%MODELS_DIR%\%SELECTED_MODEL%"
253
+
254
+ echo Starting llama-server with %SELECTED_MODEL% on GPU...
255
+ echo.
256
+
257
+ REM --- START SERVER ---
258
+ start "" "%SERVER_EXE%" --n-gpu-layers %GPU_LAYERS% --ctx-size %CONTEXT_SIZE% --port %PORT% --host %HOST_IP% -m %MODEL_PATH%
259
+
260
+ REM --- OPEN CHROME AUTOMATICALLY ---
261
+ timeout /t 2 >nul
262
+ start "" chrome http://127.0.0.1:%PORT%/
263
+
264
+ echo.
265
+ echo 🦙 Server started. Browser should open automatically.
266
+ pause
267
+