forked from ggml-org/llama.vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
424 lines (424 loc) · 14.4 KB
/
package.json
File metadata and controls
424 lines (424 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
{
"name": "llama-vscode",
"displayName": "llama-vscode",
"description": "Local LLM-assisted text completion using llama.cpp",
"version": "0.0.12",
"publisher": "ggml-org",
"repository": "https://github.com/ggml-org/llama.vscode",
"engines": {
"vscode": "^1.70.0"
},
"icon": "llama.png",
"activationEvents": [
"onLanguage:plaintext",
"onLanguage:javascript",
"onLanguage:typescript",
"onCommand.acceptFirstLine"
],
"main": "./dist/extension.js",
"contributes": {
"languages": [
{
"id": "plaintext",
"aliases": [
"Plain Text"
],
"extensions": [
".txt"
]
}
],
"commands": [
{
"command": "extension.triggerInlineCompletion",
"title": "llama-vscode: Trigger Inline Completion"
},
{
"command": "extension.triggerNoCacheCompletion",
"title": "llama-vscode: Trigger No Cache Completion"
},
{
"command": "extension.copyIntercept",
"title": "llama-vscode: Copy Intercept"
},
{
"command": "extension.cutIntercept",
"title": "llama-vscode: Cut Intercept"
},
{
"command": "extension.acceptFirstLine",
"title": "llama-vscode: Accept First Line"
},
{
"command": "extension.acceptFirstWord",
"title": "llama-vscode: Accept First Word"
},
{
"command": "extension.copyChunks",
"title": "llama-vscode: Copy Chunks"
},
{
"command": "extension.showMenu",
"title": "llama-vscode: Show Menu"
},
{
"command": "extension.askAi",
"title": "llama-vscode: Ask AI"
},
{
"command": "extension.askAiWithContext",
"title": "llama-vscode: Ask AI With Context"
},
{
"command": "extension.editSelectedText",
"title": "llama-vscode: Edit Selected Text with AI"
},
{
"command": "extension.acceptTextEdit",
"title": "llama-vscode: Accept Text Edit Suggestion"
},
{
"command": "extension.rejectTextEdit",
"title": "llama-vscode: Reject Text Edit Suggestion"
},
{
"command": "extension.generateGitCommitMessage",
"title": "llama-vscode: Generate Commit Message",
"icon": "$(sparkle)"
}
],
"keybindings": [
{
"key": "tab",
"command": "editor.action.inlineSuggest.commit",
"when": "inlineSuggestionVisible"
},
{
"command": "extension.triggerInlineCompletion",
"key": "ctrl+l",
"when": "editorTextFocus"
},
{
"command": "extension.triggerNoCacheCompletion",
"key": "ctrl+shift+l",
"when": "editorTextFocus"
},
{
"command": "extension.copyChunks",
"key": "ctrl+shift+,",
"when": "true"
},
{
"command": "extension.copyIntercept",
"key": "ctrl+c",
"when": "editorTextFocus"
},
{
"command": "extension.cutIntercept",
"key": "ctrl+x",
"when": "editorTextFocus"
},
{
"command": "extension.acceptFirstLine",
"key": "shift+tab",
"when": "editorTextFocus && inlineSuggestionVisible"
},
{
"command": "extension.acceptFirstWord",
"key": "ctrl+right",
"when": "editorTextFocus && inlineSuggestionVisible"
},
{
"command": "extension.showMenu",
"key": "ctrl+shift+m",
"when": "true"
},
{
"command": "extension.askAi",
"key": "ctrl+;",
"when": "editorTextFocus"
},
{
"command": "extension.askAiWithContext",
"key": "ctrl+Shift+;",
"when": "editorTextFocus"
},
{
"command": "extension.editSelectedText",
"key": "ctrl+shift+e",
"when": "editorHasSelection"
},
{
"command": "extension.acceptTextEdit",
"key": "tab",
"when": "editorTextFocus && textEditSuggestionVisible"
},
{
"command": "extension.rejectTextEdit",
"key": "escape",
"when": "editorTextFocus && textEditSuggestionVisible"
}
],
"configuration": {
"type": "object",
"title": "llama.vscode Configuration",
"properties": {
"llama-vscode.launch_completion": {
"type": "string",
"default": "cd c:/ai ; ./llama-server.exe -m Qwen2.5-Coder-1.5B.Q8_0.gguf --host 0.0.0.0 --port 8012 -c 2048 -ub 1024 -b 1024 -dt 0.1 --ctx-size 0 --cache-reuse 256",
"description": "Shell command for starting fim llama.cpp server, executed from the menu"
},
"llama-vscode.launch_chat": {
"type": "string",
"default": "cd c:/ai ; ./llama-server.exe -m qwen2.5-coder-3b-instruct-q6_k.gguf -ngl 99 --port 8011 --path C:/llama.cpp/llama.cpp/examples/server/webui/dist",
"description": "Shell command for starting chat llama.cpp server, executed from the menu"
},
"llama-vscode.launch_embeddings": {
"type": "string",
"default": "cd c:/ai ; ./llama-server.exe -m all-MiniLM-L6-v2-Q8_0.gguf --port 8010",
"description": "Shell command for starting chat llama.cpp server, executed from the menu"
},
"llama-vscode.launch_training_completion": {
"type": "string",
"default": "",
"description": "Shell command for starting training a completion (fim) model from the menu"
},
"llama-vscode.launch_training_chat": {
"type": "string",
"default": "",
"description": "Shell command for starting training a chat model from the menu"
},
"llama-vscode.lora_completion": {
"type": "string",
"default": "",
"description": "Path to the lora adapter file for the completion model. If not empty it will be used (appends --lora lora_completion) on starting the completion server with launch_completion"
},
"llama-vscode.lora_chat": {
"type": "string",
"default": "",
"description": "Path to the lora adapter file for the chat model. If not empty it will be used (appends --lora lora_chat) on starting the completion server with launch_chat"
},
"llama-vscode.endpoint": {
"type": "string",
"default": "http://127.0.0.1:8012",
"description": "The URL to be used by the extension for code completion."
},
"llama-vscode.endpoint_chat": {
"type": "string",
"default": "http://127.0.0.1:8011",
"description": "The URL to be used by the extension for chat with ai."
},
"llama-vscode.endpoint_embeddings": {
"type": "string",
"default": "http://127.0.0.1:8010",
"description": "The URL to be used by the extension for creating embeddings."
},
"llama-vscode.auto": {
"type": "boolean",
"default": true,
"description": "If code completion should be trggered automatically (true) or only by pressing Ctrl+l."
},
"llama-vscode.api_key": {
"type": "string",
"default": "",
"description": "llama.cpp completion server api key or OpenAI endpoint API key (optional)"
},
"llama-vscode.api_key_chat": {
"type": "string",
"default": "",
"description": "llama.cpp chat server api key"
},
"llama-vscode.api_key_embeddings": {
"type": "string",
"default": "",
"description": "llama.cpp embeddings server api key"
},
"llama-vscode.self_signed_certificate": {
"type": "string",
"default": "",
"description": "self-signed certificate file - path/to/cert.pem"
},
"llama-vscode.n_prefix": {
"type": "number",
"default": 256,
"description": "number of lines before the cursor location to include in the local prefix"
},
"llama-vscode.n_suffix": {
"type": "number",
"default": 64,
"description": "number of lines after the cursor location to include in the local suffix"
},
"llama-vscode.n_predict": {
"type": "number",
"default": 128,
"description": "max number of tokens to predict"
},
"llama-vscode.t_max_prompt_ms": {
"type": "number",
"default": 500,
"description": "max alloted time for the prompt processing (TODO: not yet supported)"
},
"llama-vscode.t_max_predict_ms": {
"type": "number",
"default": 500,
"description": "max alloted time for the prediction"
},
"llama-vscode.show_info": {
"type": "boolean",
"default": true,
"description": "show extra info about the inference (false - disabled, true - show extra info in status line)"
},
"llama-vscode.max_line_suffix": {
"type": "number",
"default": 8,
"description": "do not auto-trigger FIM completion if there are more than this number of characters to the right of the cursor"
},
"llama-vscode.max_cache_keys": {
"type": "number",
"default": 250,
"description": "max number of cached completions to keep in result_cache"
},
"llama-vscode.ring_n_chunks": {
"type": "number",
"default": 16,
"description": "max number of chunks to pass as extra context to the server (0 to disable)"
},
"llama-vscode.ring_chunk_size": {
"type": "number",
"default": 64,
"description": "max size of the chunks (in number of lines). Note: adjust these numbers so that you don't overrun your context at ring_n_chunks = 64 and ring_chunk_size = 64 you need ~32k context"
},
"llama-vscode.ring_scope": {
"type": "number",
"default": 1024,
"description": "the range around the cursor position (in number of lines) for gathering chunks after FIM"
},
"llama-vscode.ring_update_ms": {
"type": "number",
"default": 1000,
"description": "how often to process queued chunks in normal mode"
},
"llama-vscode.rag_enabled": {
"type": "boolean",
"default": true,
"description": "Enable/disable rag features - i.e. chat with AI with project context"
},
"llama-vscode.rag_chunk_max_chars": {
"type": "number",
"default": 2000,
"description": "Max number of chars per RAG chunk"
},
"llama-vscode.rag_max_lines_per_chunk": {
"type": "number",
"default": 60,
"description": "Max number of lines per RAG chunk"
},
"llama-vscode.rag_max_chars_per_chunk_line": {
"type": "number",
"default": 300,
"description": "max chars for a chunk line, the rest of the line is cut"
},
"llama-vscode.rag_max_files": {
"type": "number",
"default": 10000,
"description": "max files to index for RAG search, 0 to switch off indexing"
},
"llama-vscode.rag_max_chunks": {
"type": "number",
"default": 30000,
"description": "max cunks for the RAG search"
},
"llama-vscode.rag_max_bm25_filter_chunks": {
"type": "number",
"default": 47,
"description": "max RAG chunks to filter with BM25 algorithm"
},
"llama-vscode.rag_max_embedding_filter_chunks": {
"type": "number",
"default": 5,
"description": "max RAG chunks to provide as context to the LLM"
},
"llama-vscode.rag_max_context_files": {
"type": "number",
"default": 3,
"description": "max number of complete files to send as context to the LLM"
},
"llama-vscode.rag_max_context_file_chars": {
"type": "number",
"default": 5000,
"description": "max chars for a context file. If the file is bigger it will be cut to avoid too big context."
},
"llama-vscode.language": {
"type": "string",
"default": "en",
"description": "language: bg - Bulgarian (Български), cn - Chinese (中文), en - English, fr - French (Français), de - German (Deutsch), ru - Russian (Русский), es - Spanish (Español)"
},
"llama-vscode.enabled": {
"type": "boolean",
"default": true,
"description": "Enable/disable completions"
},
"llama-vscode.languageSettings": {
"type": "object",
"default": {
"*": true
},
"additionalProperties": {
"type": "boolean"
},
"description": "Enable/disable suggestions for specific languages"
},
"llama-vscode.use_openai_endpoint": {
"type": "boolean",
"default": false,
"description": "[EXPERIMENTAL] Use OAI endpoint. Slow and poor quality - avoid using"
},
"llama-vscode.openai_client_model": {
"type": "string",
"default": "",
"description": "The FIM friendly model supported by your OpenAI compatible endpoint to be used (e.g., Qwen2.5-Coder-14B-4-bit)"
},
"llama-vscode.openai_prompt_template": {
"type": "string",
"default": "<|fim_prefix|>{inputPrefix}{prompt}<|fim_suffix|>{inputSuffix}<|fim_middle|>",
"description": "The prompt template to be used for the OpenAI compatible endpoint."
}
}
},
"menus": {
"scm/title": [
{
"command": "extension.generateGitCommitMessage",
"when": "scmProvider == git",
"group": "navigation"
}
],
"editor/context": [
{
"command": "extension.editSelectedText",
"when": "editorHasSelection",
"group": "llama@1"
}
]
}
},
"scripts": {
"watch": "tsc -watch -p ./"
},
"dependencies": {
"axios": "^1.1.2",
"ignore": "^7.0.4",
"openai": "^4.80.1"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^18.0.0",
"@types/vscode": "^1.70.0",
"typescript": "^4.8.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0"
},
"extensionDependencies": [
"vscode.git"
]
}