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/server/tests/fixtures/mcp_slow_server.py from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 3.6 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/fixtures/mcp_slow_server.py
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/server/tests/fixtures/mcp_slow_server.py
-
curl -L -o mcp_slow_server.py https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/tests/fixtures/mcp_slow_server.py
3.6 kB
| #!/usr/bin/env python3 | |
| """ | |
| MCP server that sleeps before responding, for timeout testing. | |
| """ | |
| import json | |
| import sys | |
| import os | |
| import time | |
| import argparse | |
| TOOLS = [ | |
| { | |
| "name": "sleep", | |
| "description": "Sleep for a given number of seconds", | |
| "inputSchema": { | |
| "type": "object", | |
| "properties": { | |
| "seconds": {"type": "number", "description": "Seconds to sleep"} | |
| }, | |
| "required": ["seconds"] | |
| } | |
| } | |
| ] | |
| def handle_initialize(params, req_id): | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "result": { | |
| "protocolVersion": "2024-11-05", | |
| "capabilities": {"tools": {}}, | |
| "serverInfo": {"name": "slow-test", "version": "1.0"} | |
| } | |
| } | |
| def handle_tools_list(params, req_id): | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "result": {"tools": TOOLS} | |
| } | |
| def handle_tools_call(params, req_id): | |
| tool_name = params.get("name") | |
| arguments = params.get("arguments", {}) | |
| if tool_name == "sleep": | |
| seconds = arguments.get("seconds", 1) | |
| time.sleep(seconds) | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "result": { | |
| "content": [{"type": "text", "text": f"slept {seconds}s"}] | |
| } | |
| } | |
| else: | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "error": {"code": -32602, "message": f"Unknown tool: {tool_name}"} | |
| } | |
| HANDLERS = { | |
| "initialize": handle_initialize, | |
| "tools/list": handle_tools_list, | |
| "tools/call": handle_tools_call, | |
| } | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--delay", type=float, default=5.0, help="Delay in seconds for sleep tool") | |
| args = parser.parse_args() | |
| # Override the sleep duration | |
| global handle_tools_call | |
| def handle_tools_call(params, req_id): | |
| tool_name = params.get("name") | |
| arguments = params.get("arguments", {}) | |
| if tool_name == "sleep": | |
| seconds = arguments.get("seconds", args.delay) | |
| time.sleep(seconds) | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "result": { | |
| "content": [{"type": "text", "text": f"slept {seconds}s"}] | |
| } | |
| } | |
| else: | |
| return { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "error": {"code": -32602, "message": f"Unknown tool: {tool_name}"} | |
| } | |
| sys.stdout = os.fdopen(sys.stdout.fileno(), "w", buffering=1) | |
| sys.stderr = os.fdopen(sys.stderr.fileno(), "w", buffering=1) | |
| for line in sys.stdin: | |
| line = line.strip() | |
| if not line: | |
| continue | |
| try: | |
| request = json.loads(line) | |
| except json.JSONDecodeError: | |
| continue | |
| method = request.get("method") | |
| req_id = request.get("id") | |
| params = request.get("params", {}) | |
| # JSON-RPC 2.0: a message without an id is a notification and must not receive a response | |
| if req_id is None: | |
| continue | |
| handler = HANDLERS.get(method) | |
| if handler: | |
| response = handler(params, req_id) | |
| else: | |
| response = { | |
| "jsonrpc": "2.0", | |
| "id": req_id, | |
| "error": {"code": -32601, "message": f"Method not found: {method}"} | |
| } | |
| sys.stdout.write(json.dumps(response) + "\n") | |
| sys.stdout.flush() | |
| if __name__ == "__main__": | |
| main() | |