Instructions to use netease-youdao/Confucius4_GGUF 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 netease-youdao/Confucius4_GGUF 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 netease-youdao/Confucius4_GGUF:Q5_K_M # Run inference directly in the terminal: llama cli -hf netease-youdao/Confucius4_GGUF:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf netease-youdao/Confucius4_GGUF:Q5_K_M # Run inference directly in the terminal: llama cli -hf netease-youdao/Confucius4_GGUF:Q5_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 netease-youdao/Confucius4_GGUF:Q5_K_M # Run inference directly in the terminal: ./llama-cli -hf netease-youdao/Confucius4_GGUF:Q5_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 netease-youdao/Confucius4_GGUF:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf netease-youdao/Confucius4_GGUF:Q5_K_M
Use Docker
docker model run hf.co/netease-youdao/Confucius4_GGUF:Q5_K_M
- LM Studio
- Jan
- Ollama
How to use netease-youdao/Confucius4_GGUF with Ollama:
ollama run hf.co/netease-youdao/Confucius4_GGUF:Q5_K_M
- Unsloth Desktop
- Pi
How to use netease-youdao/Confucius4_GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf netease-youdao/Confucius4_GGUF:Q5_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": "netease-youdao/Confucius4_GGUF:Q5_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use netease-youdao/Confucius4_GGUF with Docker Model Runner:
docker model run hf.co/netease-youdao/Confucius4_GGUF:Q5_K_M
- Lemonade
How to use netease-youdao/Confucius4_GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull netease-youdao/Confucius4_GGUF:Q5_K_M
Run and chat with the model
lemonade run user.Confucius4_GGUF-Q5_K_M
List all available models
lemonade list
- Hermes Agent
How to use netease-youdao/Confucius4_GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf netease-youdao/Confucius4_GGUF:Q5_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 netease-youdao/Confucius4_GGUF:Q5_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netease-youdao/Confucius4_GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf netease-youdao/Confucius4_GGUF:Q5_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 "netease-youdao/Confucius4_GGUF:Q5_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"
Upload run_gguf_server.sh with huggingface_hub
Browse files- run_gguf_server.sh +119 -0
run_gguf_server.sh
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 17 |
+
echo ""
|
| 18 |
+
echo "MODEL: quant type (Q4_K_M, IQ3_M), file path, or empty for auto-detect"
|
| 19 |
+
echo ""
|
| 20 |
+
echo "Options:"
|
| 21 |
+
echo " -p PORT port (default 8080)"
|
| 22 |
+
echo " -c CTX context length (default 4096)"
|
| 23 |
+
echo " -g GPUS GPU devices (default 0, e.g. 0,1)"
|
| 24 |
+
echo " -ngl LAYERS GPU layers (default 99)"
|
| 25 |
+
echo " --cpu disable GPU"
|
| 26 |
+
echo ""
|
| 27 |
+
echo "Examples:"
|
| 28 |
+
echo " sh run_gguf_server.sh Q4_K_M"
|
| 29 |
+
echo " sh run_gguf_server.sh Q4_K_M -p 8080 -g 0,1 -c 8192"
|
| 30 |
+
echo " sh run_gguf_server.sh bf16/Confucius4-Q4_K_M.gguf --cpu"
|
| 31 |
+
exit 1
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
# parse args
|
| 35 |
+
while [ $# -gt 0 ]; do
|
| 36 |
+
case "$1" in
|
| 37 |
+
-p) PORT="$2"; shift 2 ;;
|
| 38 |
+
-c) N_CTX="$2"; shift 2 ;;
|
| 39 |
+
-g) GPUS="$2"; shift 2 ;;
|
| 40 |
+
-ngl) GPU_LAYERS="$2"; shift 2 ;;
|
| 41 |
+
--cpu) USE_GPU=OFF; shift ;;
|
| 42 |
+
-h|--help) usage ;;
|
| 43 |
+
-*) echo "Unknown: $1"; usage ;;
|
| 44 |
+
*) MODEL="$1"; shift ;;
|
| 45 |
+
esac
|
| 46 |
+
done
|
| 47 |
+
|
| 48 |
+
# resolve model
|
| 49 |
+
if [ -z "$MODEL" ]; then
|
| 50 |
+
# auto-detect: prefer quantized, then f16
|
| 51 |
+
MODEL=$(ls "$BASE"/*/Confucius4-*.gguf 2>/dev/null | head -1)
|
| 52 |
+
if [ -z "$MODEL" ]; then
|
| 53 |
+
MODEL=$(ls "$BASE"/bf16/Confucius4-00001-of-*.gguf 2>/dev/null | head -1)
|
| 54 |
+
fi
|
| 55 |
+
else
|
| 56 |
+
# if it's a quant type like Q4_K_M, look in that dir
|
| 57 |
+
if [ -d "$BASE/$MODEL" ] && [ -f "$BASE/$MODEL/Confucius4-$MODEL.gguf" ]; then
|
| 58 |
+
MODEL="$BASE/$MODEL/Confucius4-$MODEL.gguf"
|
| 59 |
+
elif [ -d "$BASE/$MODEL" ]; then
|
| 60 |
+
# dir exists, find first gguf inside
|
| 61 |
+
MODEL=$(ls "$BASE/$MODEL"/Confucius4-*.gguf 2>/dev/null | head -1)
|
| 62 |
+
[ -z "$MODEL" ] && { echo "ERROR: no gguf in $BASE/$MODEL/"; exit 1; }
|
| 63 |
+
fi
|
| 64 |
+
fi
|
| 65 |
+
|
| 66 |
+
[ -f "$MODEL" ] || { echo "ERROR: model not found: $MODEL"; exit 1; }
|
| 67 |
+
|
| 68 |
+
# auto-detect mmproj
|
| 69 |
+
MMPROJ=""
|
| 70 |
+
MODEL_DIR=$(dirname "$MODEL")
|
| 71 |
+
# Look for mmproj in the same directory as the model, or in f16 dir
|
| 72 |
+
for candidate in "$MODEL_DIR"/mmproj-*.gguf "$BASE"/bf16/mmproj-*.gguf; do
|
| 73 |
+
[ -f "$candidate" ] && { MMPROJ="$candidate"; break; }
|
| 74 |
+
done
|
| 75 |
+
|
| 76 |
+
# build llama-server if needed
|
| 77 |
+
SERVER_BIN="$LLAMA_CPP_DIR/build/bin/llama-server"
|
| 78 |
+
CUDA_BUILD_DIR="$LLAMA_CPP_DIR/build-cuda"
|
| 79 |
+
if [ "$USE_GPU" = "ON" ]; then
|
| 80 |
+
SERVER_BIN="$CUDA_BUILD_DIR/bin/llama-server"
|
| 81 |
+
if [ ! -f "$SERVER_BIN" ]; then
|
| 82 |
+
echo "=== Building llama-server (CUDA) ==="
|
| 83 |
+
cmake -S "$LLAMA_CPP_DIR" -B "$CUDA_BUILD_DIR" \
|
| 84 |
+
-DBUILD_SHARED_LIBS=OFF -DLLAMA_CURL=OFF \
|
| 85 |
+
-DGGML_CUDA=ON 2>&1 | tail -1
|
| 86 |
+
cmake --build "$CUDA_BUILD_DIR" --target llama-server -j$(nproc) 2>&1 | tail -3
|
| 87 |
+
fi
|
| 88 |
+
else
|
| 89 |
+
if [ ! -f "$SERVER_BIN" ]; then
|
| 90 |
+
echo "=== Building llama-server (CPU) ==="
|
| 91 |
+
cmake -S "$LLAMA_CPP_DIR" -B "$LLAMA_CPP_DIR/build" -DBUILD_SHARED_LIBS=OFF -DLLAMA_CURL=OFF 2>&1 | tail -1
|
| 92 |
+
cmake --build "$LLAMA_CPP_DIR/build" --target llama-server -j$(nproc) 2>&1 | tail -3
|
| 93 |
+
fi
|
| 94 |
+
fi
|
| 95 |
+
|
| 96 |
+
echo "=== Starting server ==="
|
| 97 |
+
echo " model: $MODEL"
|
| 98 |
+
echo " port: $PORT"
|
| 99 |
+
echo " ctx: $N_CTX"
|
| 100 |
+
if [ -n "$MMPROJ" ]; then
|
| 101 |
+
echo " mmproj: $MMPROJ"
|
| 102 |
+
fi
|
| 103 |
+
if [ "$USE_GPU" = "ON" ]; then
|
| 104 |
+
echo " GPU: layers=$GPU_LAYERS devices=$GPUS"
|
| 105 |
+
export CUDA_VISIBLE_DEVICES=$GPUS
|
| 106 |
+
else
|
| 107 |
+
echo " GPU: off"
|
| 108 |
+
fi
|
| 109 |
+
echo " API: http://localhost:$PORT/v1/chat/completions"
|
| 110 |
+
echo ""
|
| 111 |
+
|
| 112 |
+
MMPROJ_ARG=()
|
| 113 |
+
[ -n "$MMPROJ" ] && MMPROJ_ARG=(--mmproj "$MMPROJ")
|
| 114 |
+
|
| 115 |
+
if [ "$USE_GPU" = "ON" ]; then
|
| 116 |
+
"$SERVER_BIN" -m "$MODEL" --port "$PORT" --host 0.0.0.0 -c "$N_CTX" -ngl "$GPU_LAYERS" --parallel 1 "${MMPROJ_ARG[@]}"
|
| 117 |
+
else
|
| 118 |
+
"$SERVER_BIN" -m "$MODEL" --port "$PORT" --host 0.0.0.0 -c "$N_CTX" --parallel 1 "${MMPROJ_ARG[@]}"
|
| 119 |
+
fi
|