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/mention-badge.ts from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 4.02 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/ui/src/lib/utils/mention-badge.ts
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/ui/src/lib/utils/mention-badge.ts
-
curl -L -o mention-badge.ts https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/ui/src/lib/utils/mention-badge.ts
4.02 kB
| import { abbreviateHome, lastPathSegment } from './path-display'; | |
| import { | |
| DIRECTORY_PATH_SUFFIX, | |
| FILE_URI_PREFIX, | |
| MENTION_BADGE_FILE_ICON_PATHS, | |
| MENTION_BADGE_FOLDER_ICON_PATHS, | |
| MENTION_LINK_SCAN_FLAGS | |
| } from '$lib/constants'; | |
| import { FileMentionEntryType } from '$lib/enums'; | |
| import type { FileMentionEntry } from '$lib/types'; | |
| export { | |
| MENTION_BADGE_CLASSNAME, | |
| MENTION_BADGE_ICON_CLASSNAME, | |
| MENTION_BADGE_SVG_ATTRIBUTES, | |
| MENTION_BADGE_FILE_ICON_PATHS, | |
| MENTION_BADGE_FOLDER_ICON_PATHS | |
| } from '$lib/constants'; | |
| // `)` is allowed in a path only when not followed by whitespace or `[`, | |
| // so macOS paths parse while adjacent badges still terminate the match. | |
| const FILE_MENTION_LINK_SOURCE = String.raw`\[([^\]\n]+?)\]\(file:\/\/((?:[^)\n]|\)(?![\s[]))+)\)`; | |
| export function fileMentionLinkRe(flags = ''): RegExp { | |
| return new RegExp(FILE_MENTION_LINK_SOURCE, flags); | |
| } | |
| export function containsFileMentionLink(value: string): boolean { | |
| return fileMentionLinkRe().test(value); | |
| } | |
| // Escape each path segment for a markdown link destination (spaces/parens | |
| // break CommonMark); keeps the trailing slash that marks a directory. | |
| export function encodeFileLinkPath(path: string): string { | |
| return path | |
| .split('/') | |
| .map((segment) => encodeURIComponent(segment)) | |
| .join('/'); | |
| } | |
| // Malformed escape sequences fall back to the input unchanged. | |
| export function decodeFileLinkPath(path: string): string { | |
| try { | |
| return path | |
| .split('/') | |
| .map((segment) => decodeURIComponent(segment)) | |
| .join('/'); | |
| } catch { | |
| return path; | |
| } | |
| } | |
| export interface MentionTextSegment { | |
| text: string; | |
| mention: { name: string; path: string } | null; | |
| } | |
| /** | |
| * Split raw text into plain runs and `[name](file://path)` mentions. | |
| * The raw-text renderers walk these segments to draw badges without | |
| * handing the message to the markdown parser, so a `#` stays a `#`. | |
| */ | |
| export function splitMentionSegments(value: string): MentionTextSegment[] { | |
| const linkRe = fileMentionLinkRe(MENTION_LINK_SCAN_FLAGS); | |
| const segments: MentionTextSegment[] = []; | |
| let cursor = 0; | |
| let match: RegExpExecArray | null; | |
| while ((match = linkRe.exec(value)) !== null) { | |
| if (match.index > cursor) { | |
| segments.push({ mention: null, text: value.slice(cursor, match.index) }); | |
| } | |
| segments.push({ | |
| mention: { name: match[1], path: decodeFileLinkPath(match[2]) }, | |
| text: match[0] | |
| }); | |
| cursor = match.index + match[0].length; | |
| } | |
| if (cursor < value.length) segments.push({ mention: null, text: value.slice(cursor) }); | |
| return segments; | |
| } | |
| export function getMentionBadgeIconPaths(path: string): readonly string[] { | |
| return path.endsWith(DIRECTORY_PATH_SUFFIX) | |
| ? MENTION_BADGE_FOLDER_ICON_PATHS | |
| : MENTION_BADGE_FILE_ICON_PATHS; | |
| } | |
| export function getMentionBadgeLabel( | |
| name: string, | |
| path: string, | |
| showFullPath: boolean, | |
| home?: string | null | |
| ): string { | |
| if (!showFullPath) return name; | |
| const decoded = decodeFileLinkPath(path.replace(/\/+$/, '')); | |
| if (!decoded) return name; | |
| return abbreviateHome(decoded, home); | |
| } | |
| /** | |
| * Build the markdown link that replaces a mention token. Entry `path` is | |
| * already rooted, so `file://` + `/abs` yields the canonical `file:///`. | |
| * Null when the token is invalid. | |
| */ | |
| export function buildMentionInsertion( | |
| entry: FileMentionEntry, | |
| value: string, | |
| token: { start: number; end: number } | |
| ): { newValue: string; caretOffset: number } | null { | |
| if (token.start < 0 || token.end > value.length || token.start > token.end) return null; | |
| // Strip the entry's directory marker so it is not doubled below. | |
| const cleanedPath = entry.path.replace(/\/+$/, ''); | |
| const pathWithSeparator = | |
| entry.type === FileMentionEntryType.DIRECTORY ? `${cleanedPath}/` : cleanedPath; | |
| const basename = lastPathSegment(cleanedPath) || entry.name; | |
| const insertion = `[${basename}](${FILE_URI_PREFIX}${encodeFileLinkPath(pathWithSeparator)}) `; | |
| const newValue = value.slice(0, token.start) + insertion + value.slice(token.end); | |
| return { caretOffset: token.start + insertion.length, newValue }; | |
| } | |