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/server-http.h from VladHong/llama-cpp-K2-FAST2: direct link, hf CLI and curl.
- Browser
- Download file 3.12 kB
-
https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/server-http.h
- Command line
-
hf download hf://VladHong/llama-cpp-K2-FAST2/tools/server/server-http.h
-
curl -L -o server-http.h https://huggingface.co/VladHong/llama-cpp-K2-FAST2/resolve/main/tools/server/server-http.h
3.12 kB
| struct common_params; | |
| // generator-like API for HTTP response generation | |
| // this object response with one of the 2 modes: | |
| // 1) normal response: `data` contains the full response body | |
| // 2) streaming response: each call to next(output) generates the next chunk | |
| // when next(output) returns false, no more data after the current chunk | |
| // note: some chunks can be empty, in which case no data is sent for that chunk | |
| struct server_http_res { | |
| std::string content_type = "application/json; charset=utf-8"; | |
| int status = 200; | |
| std::string data; | |
| std::map<std::string, std::string> headers; | |
| std::function<bool(std::string &)> next = nullptr; | |
| bool is_stream() const { | |
| return next != nullptr; | |
| } | |
| // fired before req and res are destroyed | |
| virtual void on_complete() {} | |
| virtual ~server_http_res() = default; | |
| }; | |
| // unique pointer, used by set_chunked_content_provider | |
| // httplib requires the stream provider to be stored in heap | |
| using server_http_res_ptr = std::unique_ptr<server_http_res>; | |
| using raw_buffer = std::vector<uint8_t>; | |
| struct uploaded_file { | |
| raw_buffer data; | |
| std::string filename; | |
| std::string content_type; | |
| }; | |
| struct server_http_req { | |
| std::map<std::string, std::string> params; // path_params + query_params | |
| std::map<std::string, std::string> headers; // used by MCP proxy | |
| std::string path; | |
| std::string query_string; // query parameters string (e.g. "action=save") | |
| std::string body; | |
| std::map<std::string, uploaded_file> files; // used for file uploads (form data) | |
| const std::function<bool()> & should_stop; | |
| std::string get_param(const std::string & key, const std::string & def = "") const { | |
| auto it = params.find(key); | |
| if (it != params.end()) { | |
| return it->second; | |
| } | |
| return def; | |
| } | |
| }; | |
| struct server_http_context { | |
| class Impl; | |
| std::unique_ptr<Impl> pimpl; | |
| std::thread thread; // server thread | |
| std::atomic<bool> is_ready = false; | |
| // note: the handler should never throw exceptions | |
| using handler_t = std::function<server_http_res_ptr(const server_http_req & req)>; | |
| mutable std::unordered_map<std::string, handler_t> handlers; | |
| std::string path_prefix; | |
| std::string hostname; | |
| int port = 8080; | |
| bool is_ssl = false; | |
| server_http_context(); | |
| ~server_http_context(); | |
| bool init(const common_params & params); | |
| bool start(); | |
| void stop() const; | |
| void get(const std::string & path, const handler_t & handler) const; | |
| void post(const std::string & path, const handler_t & handler) const; | |
| void del(const std::string & path, const handler_t & handler) const; | |
| // Register the Google Cloud Platform (Vertex AI) compat (AIP_PREDICT_ROUTE env var, or /predict) | |
| // Must be called AFTER all other API routes are registered | |
| void register_gcp_compat() const; | |
| // for debugging | |
| std::string listening_address; | |
| }; | |