Instructions to use VladHong/llama-cpp-K2-FAST2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use VladHong/llama-cpp-K2-FAST2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: llama cli -hf VladHong/llama-cpp-K2-FAST2
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: llama cli -hf VladHong/llama-cpp-K2-FAST2
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf VladHong/llama-cpp-K2-FAST2 # Run inference directly in the terminal: ./build/bin/llama cli -hf VladHong/llama-cpp-K2-FAST2
Use Docker
docker model run hf.co/VladHong/llama-cpp-K2-FAST2
- Llama new
- LM Studio
- Jan
- Ollama
How to use VladHong/llama-cpp-K2-FAST2 with Ollama:
ollama run hf.co/VladHong/llama-cpp-K2-FAST2
- Unsloth Desktop
- Docker Model Runner
How to use VladHong/llama-cpp-K2-FAST2 with Docker Model Runner:
docker model run hf.co/VladHong/llama-cpp-K2-FAST2
- Lemonade
How to use VladHong/llama-cpp-K2-FAST2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull VladHong/llama-cpp-K2-FAST2
Run and chat with the model
lemonade run user.llama-cpp-K2-FAST2-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download tools/ui/src/lib/utils/compute-line-diff.ts from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 3.28 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/ui/src/lib/utils/compute-line-diff.ts
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/ui/src/lib/utils/compute-line-diff.ts
-
curl -L -o compute-line-diff.ts https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/ui/src/lib/utils/compute-line-diff.ts
3.28 kB
| /** | |
| * Line-level unified diff for tool result rendering. | |
| * | |
| * Pure functions: no DOM, no Svelte, no highlight.js dependency. The | |
| * returned `DiffLine[]` carries enough information both to render a | |
| * custom diff block (per-entry kind/text) and to fold back into a | |
| * unified-diff-format string for off-the-shelf highlighter languages | |
| * (`renderUnifiedDiff`). | |
| * | |
| * Algorithm: LCS dynamic programming with a soft "remove before add" | |
| * tiebreak so the resulting diff reads `(old -> new)` left to right. | |
| * O(m*n) time/space which is fine for the handful of lines an | |
| * `edit_file` snippet typically carries. | |
| */ | |
| import { DiffLineKind } from '$lib/enums'; | |
| export interface DiffLine { | |
| kind: DiffLineKind; | |
| text: string; | |
| /** 1-indexed line number in the OLD content. Undefined for `add` lines. */ | |
| oldLine?: number; | |
| /** 1-indexed line number in the NEW content. Undefined for `remove` lines. */ | |
| newLine?: number; | |
| } | |
| export function computeLineDiff(oldText: string, newText: string): DiffLine[] { | |
| const oldLines = splitLines(oldText); | |
| const newLines = splitLines(newText); | |
| const m = oldLines.length; | |
| const n = newLines.length; | |
| if (m === 0 && n === 0) return []; | |
| if (m === 0) return newLines.map((t, k) => ({ kind: DiffLineKind.ADD, newLine: k + 1, text: t })); | |
| if (n === 0) | |
| return oldLines.map((t, k) => ({ kind: DiffLineKind.REMOVE, oldLine: k + 1, text: t })); | |
| const lcs: number[][] = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0)); | |
| for (let i = 1; i <= m; i++) { | |
| for (let j = 1; j <= n; j++) { | |
| if (oldLines[i - 1] === newLines[j - 1]) { | |
| lcs[i][j] = lcs[i - 1][j - 1] + 1; | |
| } else { | |
| lcs[i][j] = Math.max(lcs[i - 1][j], lcs[i][j - 1]); | |
| } | |
| } | |
| } | |
| const result: DiffLine[] = []; | |
| let i = m; | |
| let j = n; | |
| while (i > 0 && j > 0) { | |
| if (oldLines[i - 1] === newLines[j - 1]) { | |
| result.push({ | |
| kind: DiffLineKind.CONTEXT, | |
| newLine: j, | |
| oldLine: i, | |
| text: oldLines[i - 1] | |
| }); | |
| i--; | |
| j--; | |
| } else if (lcs[i - 1][j] >= lcs[i][j - 1]) { | |
| result.push({ kind: DiffLineKind.REMOVE, oldLine: i, text: oldLines[i - 1] }); | |
| i--; | |
| } else { | |
| result.push({ kind: DiffLineKind.ADD, newLine: j, text: newLines[j - 1] }); | |
| j--; | |
| } | |
| } | |
| while (i > 0) { | |
| result.push({ kind: DiffLineKind.REMOVE, oldLine: i, text: oldLines[i - 1] }); | |
| i--; | |
| } | |
| while (j > 0) { | |
| result.push({ kind: DiffLineKind.ADD, newLine: j, text: newLines[j - 1] }); | |
| j--; | |
| } | |
| result.reverse(); | |
| return result; | |
| } | |
| /** Folds `DiffLine[]` into a unified-diff-format text (`` ` ``/`+`/`-` prefixes). | |
| * Pass to a diff-aware highlighter (e.g., SyntaxHighlightedCode with | |
| * `language="diff"`) for colorization. | |
| */ | |
| export function renderUnifiedDiff(lines: DiffLine[]): string { | |
| if (lines.length === 0) return ''; | |
| return lines.map((l) => prefixFor(l.kind) + l.text).join('\n'); | |
| } | |
| /** Column-1 marker for a `DiffLine`: ` `, `+`, or `-`. */ | |
| export function prefixFor(kind: DiffLineKind): string { | |
| if (kind === DiffLineKind.ADD) return '+'; | |
| if (kind === DiffLineKind.REMOVE) return '-'; | |
| return ' '; | |
| } | |
| function splitLines(text: string): string[] { | |
| if (text === '') return []; | |
| const parts = text.split('\n'); | |
| if (parts[parts.length - 1] === '') parts.pop(); | |
| return parts.map((l) => (l.endsWith('\r') ? l.slice(0, -1) : l)); | |
| } | |