Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"hf/WizardLM/WizardCoder-Python-34B-V1.0",
"hf/deepseek-ai/deepseek-coder-6.7b-base",
"ollama/codellama:7b",
"llamacpp/deepseek-coder6.7b-base",
"Custom"
],
"default": "hf/bigcode/starcoder",
Expand All @@ -107,7 +108,8 @@
"huggingface",
"ollama",
"openai",
"tgi"
"tgi",
"llamacpp"
],
"default": "huggingface",
"description": "Backend used by the extension"
Expand Down
36 changes: 34 additions & 2 deletions src/configTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const templateKeys = ["hf/bigcode/starcoder", "hf/codellama/CodeLlama-13b-hf", "hf/Phind/Phind-CodeLlama-34B-v2", "hf/WizardLM/WizardCoder-Python-34B-V1.0", "ollama/codellama:7b", "hf/deepseek-ai/deepseek-coder-6.7b-base", "Custom"] as const;
const templateKeys = ["hf/bigcode/starcoder", "hf/codellama/CodeLlama-13b-hf", "hf/Phind/Phind-CodeLlama-34B-v2", "hf/WizardLM/WizardCoder-Python-34B-V1.0", "ollama/codellama:7b", "hf/deepseek-ai/deepseek-coder-6.7b-base","llamacpp/deepseek-coder6.7b-base", "Custom"] as const;

export type TemplateKey = typeof templateKeys[number];

export interface TokenizerPathConfig {
Expand All @@ -16,7 +17,7 @@ export interface TokenizerUrlConfig {

export interface Config {
modelId: string;
backend: "huggingface" | "ollama" | "openai" | "tgi";
backend: "huggingface" | "ollama" | "openai" | "tgi" | "llamacpp";
url: string | null;
"fillInTheMiddle.enabled": boolean;
"fillInTheMiddle.prefix": string;
Expand Down Expand Up @@ -95,6 +96,7 @@ const HfDeepSeekConfig: Config = {
temperature: 0.1,
top_p: 0.95
}

}
}

Expand Down Expand Up @@ -129,11 +131,41 @@ const OllamaCodeLlama7BConfig: Config = {
}
}

const LlamaCppDeepSeekConfig: Config = {
modelId: "deepseek:6b",
backend: "llamacpp",
"fillInTheMiddle.enabled": true,
"fillInTheMiddle.prefix": "<|fim▁begin|>",
"fillInTheMiddle.middle": "<|fim▁end|>",
"fillInTheMiddle.suffix": "<|fim▁hole|>",
url: "http://localhost:8080/completion",
tokensToClear: ["<|end▁of▁sentence|>"],
requestBody: {
cache_prompt: true,
min_p: 0.05,
repeat_penalty:1.0,
stream: false,
top_p: 0.95,
presence_penalty: 0,
temperature: 0,
slot_id: 0,
grammar: "",
image_data: [],
top_k: 40,
n_predict: 120
},
contextWindow: 4096,
tokenizer: {
repository: "deepseek-ai/deepseek-coder-6.7b-base"
}
}

export const templates: Partial<Record<TemplateKey, Config>> = {
"hf/bigcode/starcoder": HfStarCoderConfig,
"hf/codellama/CodeLlama-13b-hf": HfCodeLlama13BConfig,
"hf/Phind/Phind-CodeLlama-34B-v2": HfPhindCodeLlama34Bv2Config,
"hf/WizardLM/WizardCoder-Python-34B-V1.0": HfWizardCoderPython34Bv1Config,
"hf/deepseek-ai/deepseek-coder-6.7b-base": HfDeepSeekConfig,
"ollama/codellama:7b": OllamaCodeLlama7BConfig,
"llamacpp/deepseek-coder6.7b-base": LlamaCppDeepSeekConfig
}