llama
Note
默认安装的 llama-cpp-python 在 Windows 只支持 CPU 或 NVIDIA CUDA GPU。
- llama-cpp-python OpenAI 兼容 API
pip install llama-cpp-python[server]
python -m llama_cpp.server --model "C:\Users\wjn.lmstudio\models\chaparro2001\Qwen3-4B-Instruct-2507-Q4_K_M-GGUF\qwen3-4b-instruct-2507-q4_k_m.gguf" --model_alias qwen --n_ctx 16382
cpu 推理
--n_gpu_layers 0 --n_threads 8 --n_ctx 4096
普通gpu
--n_gpu_layers 30 --n_ctx 8192 --n_threads 8
http://localhost:8000/v1/models