Instructions to use qwfasf/K2-Horizon-7B-UnrealEngine with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="qwfasf/K2-Horizon-7B-UnrealEngine", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("qwfasf/K2-Horizon-7B-UnrealEngine", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use qwfasf/K2-Horizon-7B-UnrealEngine 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 qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M # Run inference directly in the terminal: llama cli -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M # Run inference directly in the terminal: llama cli -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Use Docker
docker model run hf.co/qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use qwfasf/K2-Horizon-7B-UnrealEngine with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qwfasf/K2-Horizon-7B-UnrealEngine" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qwfasf/K2-Horizon-7B-UnrealEngine", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
- SGLang
How to use qwfasf/K2-Horizon-7B-UnrealEngine with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "qwfasf/K2-Horizon-7B-UnrealEngine" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qwfasf/K2-Horizon-7B-UnrealEngine", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "qwfasf/K2-Horizon-7B-UnrealEngine" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qwfasf/K2-Horizon-7B-UnrealEngine", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Ollama:
ollama run hf.co/qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
- Unsloth Desktop
- Pi
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Docker Model Runner:
docker model run hf.co/qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
- Lemonade
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Run and chat with the model
lemonade run user.K2-Horizon-7B-UnrealEngine-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use qwfasf/K2-Horizon-7B-UnrealEngine with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use qwfasf/K2-Horizon-7B-UnrealEngine with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "qwfasf/K2-Horizon-7B-UnrealEngine:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
K2-Horizon-7B Unreal Engine (Blueprint + C++)
This repository contains a standalone BF16 merge of the K2-Horizon-7B base model and the v152 Unreal Engine Blueprint + C++ adapter. The adapter was applied once to the original, unquantized BF16 base. This is export revision v160.
The model is intended for Unreal Engine Blueprint and C++ assistance. The export itself has not been evaluated with generation benchmarks; please validate its behavior on your own tasks.
GGUF for 8 GB GPUs
Use K2-Horizon-7B-UnrealEngine-Q4_K_M.gguf for local inference on an 8 GB GPU. It is a 5.59 GB Q4_K_M quantization of the merged BF16 model. The original BF16 Transformers weights remain available in this repository.
Recommended LM Studio starting settings:
- Context length: 8,192 tokens
- GPU offload: maximum/all layers
- Flash Attention: enabled
- If LM Studio reports insufficient VRAM, lower the context length to 4,096 tokens
The model metadata advertises a 524,288-token maximum context, but that context size is not practical on an 8 GB GPU. Quantization reduces model weight memory; KV cache memory still grows with context length.
In LM Studio, download or import the Q4_K_M GGUF file rather than the BF16 GGUF or Safetensors files.
Model details
- Base model: IFM/K2-Horizon-7B
- Adapter: v152 Blueprint + C++ adapter
- Export: standalone BF16 weights, adapter merged once
- Architecture:
K2HorizonForCausalLM(custom Transformers implementation included in this repository) - Transformers version used for the export:
5.17.0 - Position configuration:
max_position_embeddings = 524288 - Tokenizer and chat template are included
- Sharded model files total 18,019,196,335 bytes (~18.0 GB); runtime memory use is higher and depends on device and context length
The 524,288 position setting is a configuration value, not a claim that long-context quality has been evaluated for this export.
Load with Transformers
Install PyTorch, Accelerate, and the specified Transformers version in an environment suitable for BF16 inference:
pip install "transformers==5.17.0" accelerate
The repository includes custom model code. trust_remote_code=True allows Transformers to load and execute that code; review the files before enabling it if you do not trust the repository source.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "qwfasf/K2-Horizon-7B-UnrealEngine"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
device_map="auto",
)
The export manifest records that the standalone model reload without the adapter passed. Generation and benchmark evaluation were not run for this export.
Merge and validation notes
- The v152 adapter was merged once into the original unquantized BF16 base; no optimizer or training updates were performed during export.
- The adapter was trained using NF4, while this export merges it into the unquantized BF16 base. BF16 merge rounding means this export may differ numerically from live NF4 + LoRA inference.
- Export provenance reports 252 merged modules, 504 adapter tensors checked, and 327 saved tensors verified against the merged model.
- The tokenizer vocabulary and sample template were checked against the parent model.
- Adapter SHA-256:
62ff493e8cae7c706a9eda313ada15e7baeb04a51c11f651650bd8c4f202f363 - See
merge_provenance.jsonandexport_manifest.jsonfor the recorded checks and file hashes.
License
This derivative is published under the Apache-2.0 license, following the base model card. Review the base model's license and terms before use.
- Downloads last month
- 122