Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.
By Samagra Sharma · Reviewed September 6, 2026A small extraction or classification workload may fit on spare CPU capacity. To find out, build llama.cpp with GPU backends disabled, load a quantized model, and measure how many correct requests finish within your deadline. This guide serves Qwen2.5-1.5B-Instruct Q4_K_M through a local OpenAI-compatible API on Linux or macOS.The model is a small starting point for validating the serving path. Its ability to answer a smoke test does not establish quality for a production workload.
Reviewed September 6, 2026 against the pinned llama.cpp source and official Qwen model files. This guide has not been benchmarked on CPU hardware. It describes a standalone llama.cpp setup and does not imply additional Tensorfuse hardware support.
Install Git, curl, CMake, and a C/C++ compiler. On Ubuntu, install build-essential, cmake, git, and curl with your package manager. On macOS, install the Xcode Command Line Tools and CMake. Then create a fresh checkout:
This pins the v0.4.0 release. A fresh build directory matters because CMake remembers options from previous builds. Metal defaults on for supported Macs; disabling it makes this a CPU baseline. Other accelerator backends remain off in this fresh default configuration. See the upstream build instructions and backend options.OpenSSL support inside llama.cpp is disabled here because curl downloads the model separately and the server listens locally over HTTP.
This is the approximately 1.12 GB Q4_K_M file in Qwen’s official GGUF repository. The commit in the URL fixes the model revision. Quantization reduces weight storage; total RAM usage also includes the KV cache, compute buffers, the operating system, and other processes. Leave several GB of available memory for this initial short-context experiment and check actual usage after loading.
Use four threads as an initial setting on a machine with at least four available CPU cores; lower it on smaller hosts. The 2,048-token context must accommodate the formatted input and generated output. One server slot makes the initial latency measurement easier to interpret.In a second terminal:
curl --fail http://127.0.0.1:8080/healthcurl --fail http://127.0.0.1:8080/v1/modelscurl --fail --show-error http://127.0.0.1:8080/v1/chat/completions \ -H 'Content-Type: application/json' \ -d '{ "model": "qwen-cpu", "messages": [{ "role": "user", "content": "Classify this message as billing or technical. Reply with one label: I was charged twice." }], "temperature": 0, "max_tokens": 16 }'
Expect a successful health response after loading, qwen-cpu in the models response, and text inside choices[0].message.content. Check the label itself for correctness. The alias and endpoints follow the pinned server API. Keep the unauthenticated example on loopback and stop it with Ctrl+C when finished.
Replay representative requests, including longer inputs and failure cases. Compare warm and first-request latency, accepted requests per minute, and peak memory. Increase thread count one setting at a time while keeping the model, prompts, and output limits fixed. More threads can lose performance through memory contention or competition with other services.Compare CPU and GPU using the same task deadline and quality threshold:
cost per accepted request = total serving cost during the test window / requests meeting both quality and latency requirements
Include the full VM charge for a dedicated cloud CPU instance. For shared capacity, document its cost allocation and the impact on neighboring workloads. For owned hardware, include electricity and hardware allocation. Count retries and fallback requests. A lower hourly price can still produce a higher cost per useful result when throughput is too low.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tensorfuse","description":"Deploy and scale AI models in your AWS account. Guides to serverless GPU inference, vLLM, model serving, benchmarking, and finetuning with Tensorfuse.","colors":{"primary":"#EC5528","light":"#EC5528","dark":"#EC5528"},"logo":{"light":"https://mintcdn.com/tensorfuse-docs/dmj8dBJTiBMtkrNL/logo/logoFullwidth.png?fit=max\u0026auto=format\u0026n=dmj8dBJTiBMtkrNL\u0026q=85\u0026s=055e86590676b786ef5d267c6c430d76","dark":"https://mintcdn.com/tensorfuse-docs/dmj8dBJTiBMtkrNL/logo/logo_dark_mode.png?fit=max\u0026auto=format\u0026n=dmj8dBJTiBMtkrNL\u0026q=85\u0026s=5562a2c658f07e30317caae365ebe466"},"favicon":"https://mintcdn.com/tensorfuse-docs/dmj8dBJTiBMtkrNL/tf_logo.svg?fit=max\u0026auto=format\u0026n=dmj8dBJTiBMtkrNL\u0026q=85\u0026s=85803d36945990b7a2c8a2ca577b673c","appearance":{"default":"dark","strict":true},"background":{"color":{"dark":"#1D1D1D"}},"navbar":{"links":[{"href":"https://join.slack.com/t/tensorfusecommunity/shared_invite/zt-30r6ik3dz-Rf7nS76vWKOu6DoKh5Cs5w","label":"Community"}],"primary":{"type":"button","label":"Get Started","href":"https://app.tensorfuse.io/"}},"footer":{"socials":{"twitter":"https://twitter.com/tensorfuse","github":"https://github.com/tensorfuse","linkedin":"https://www.linkedin.com/company/tensorfuse"}},"seo":{"metatags":{"canonical":"https://tensorfuse.io/docs","og:site_name":"Tensorfuse Documentation","twitter:card":"summary_large_image","twitter:site":"@tensorfuse"}},"integrations":{"intercom":{"appId":"y9yz9hjf"},"mixpanel":{"projectToken":"754ffdc145ee654685ea74ac0fb18084"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tensorfuse-docs","hasAudioNarration":false,"actualSubdomain":"tensorfuse-docs","customDomains":["tensorfuse.io"],"gitSource":{"type":"github","owner":"samagra14","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adbe5ab1578ba4c8e43bd3c","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Documentation","count":41},{"language":"default","tag":"Reference","count":27},{"language":"default","tag":"CLI Reference","count":24},{"language":"default","tag":"Examples","count":21},{"language":"default","tag":"Blog","count":15},{"language":"default","tag":"Large Language Models","count":11},{"language":"default","tag":"Inference How-to Guides","count":8},{"language":"default","tag":"Other posts","count":7},{"language":"default","tag":"Operations","count":7},{"language":"default","tag":"Image and Video Models","count":6}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":""}],"page":{"pagePath":"guides/inference/how-to/cpu-llama-cpp","slug":"/guides/inference/how-to/cpu-llama-cpp","pageMetadata":{"title":"How to run LLM inference on a CPU with llama.cpp","description":"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.","sidebarTitle":"Run an LLM on a CPU","author":"Samagra Sharma","og:type":"article","article:author":"https://samagra.me/","href":"/guides/inference/how-to/cpu-llama-cpp"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`By `,_jsx(_components.a,{href:`/authors/samagra-sharma`,children:`Samagra Sharma`}),` · Reviewed September 6, 2026`]}),`\n`,_jsx(_components.p,{children:`A small extraction or classification workload may fit on spare CPU capacity. To find out, build llama.cpp with GPU backends disabled, load a quantized model, and measure how many correct requests finish within your deadline. This guide serves Qwen2.5-1.5B-Instruct Q4_K_M through a local OpenAI-compatible API on Linux or macOS.`}),`\n`,_jsx(_components.p,{children:`The model is a small starting point for validating the serving path. Its ability to answer a smoke test does not establish quality for a production workload.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Reviewed September 6, 2026 against the pinned llama.cpp source and official Qwen model files. This guide has not been benchmarked on CPU hardware. It describes a standalone llama.cpp setup and does not imply additional Tensorfuse hardware support.`})}),`\n`,_jsx(Heading,{level:`2`,id:`1-build-llama-cpp-for-cpu-execution`,children:`1. Build llama.cpp for CPU execution`}),`\n`,_jsxs(_components.p,{children:[`Install Git, curl, CMake, and a C/C++ compiler. On Ubuntu, install `,_jsx(_components.code,{children:`build-essential`}),`, `,_jsx(_components.code,{children:`cmake`}),`, `,_jsx(_components.code,{children:`git`}),`, and `,_jsx(_components.code,{children:`curl`}),` with your package manager. On macOS, install the Xcode Command Line Tools and CMake. Then create a fresh checkout:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` clone`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --depth`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --branch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` v0.4.0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://github.com/ggml-org/llama.cpp.git`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` llama-cpp-cpu`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` llama-cpp-cpu`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cmake`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -S`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -B`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build-cpu`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DCMAKE_BUILD_TYPE=Release`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DGGML_METAL=OFF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DGGML_CUDA=OFF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DGGML_HIP=OFF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DGGML_VULKAN=OFF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DGGML_SYCL=OFF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -DLLAMA_OPENSSL=OFF`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cmake`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --build`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build-cpu`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --config`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Release`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --target`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` llama-server`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -j`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./build-cpu/bin/llama-server`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --version`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This pins the `,_jsx(_components.a,{href:`https://github.com/ggml-org/llama.cpp/releases/tag/v0.4.0`,children:`v0.4.0 release`}),`. A fresh build directory matters because CMake remembers options from previous builds. Metal defaults on for supported Macs; disabling it makes this a CPU baseline. Other accelerator backends remain off in this fresh default configuration. See the `,_jsx(_components.a,{href:`https://github.com/ggml-org/llama.cpp/blob/v0.4.0/docs/build.md`,children:`upstream build instructions`}),` and `,_jsx(_components.a,{href:`https://github.com/ggml-org/llama.cpp/blob/v0.4.0/ggml/CMakeLists.txt`,children:`backend options`}),`.`]}),`\n`,_jsx(_components.p,{children:`OpenSSL support inside llama.cpp is disabled here because curl downloads the model separately and the server listens locally over HTTP.`}),`\n`,_jsx(Heading,{level:`2`,id:`2-download-one-gguf-file`,children:`2. Download one GGUF file`}),`\n`,_jsx(_components.p,{children:`Run from the checkout directory:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -p`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` models`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --location`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF/resolve/91cad51170dc346986eccefdc2dd33a9da36ead9/qwen2.5-1.5b-instruct-q4_k_m.gguf'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --output`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` models/qwen2.5-1.5b-instruct-q4_k_m.gguf`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This is the approximately 1.12 GB Q4_K_M file in `,_jsx(_components.a,{href:`https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF`,children:`Qwen’s official GGUF repository`}),`. The commit in the URL fixes the model revision. Quantization reduces weight storage; total RAM usage also includes the KV cache, compute buffers, the operating system, and other processes. Leave several GB of available memory for this initial short-context experiment and check actual usage after loading.`]}),`\n`,_jsx(Heading,{level:`2`,id:`3-start-the-server-and-make-a-request`,children:`3. Start the server and make a request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./build-cpu/bin/llama-server`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --model`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` models/qwen2.5-1.5b-instruct-q4_k_m.gguf`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --alias`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` qwen-cpu`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --n-gpu-layers`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --ctx-size`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 2048`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --parallel`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --threads`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --host`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 127.0.0.1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8080`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Use four threads as an initial setting on a machine with at least four available CPU cores; lower it on smaller hosts. The 2,048-token context must accommodate the formatted input and generated output. One server slot makes the initial latency measurement easier to interpret.`}),`\n`,_jsx(_components.p,{children:`In a second terminal:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http://127.0.0.1:8080/health`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http://127.0.0.1:8080/v1/models`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --show-error`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http://127.0.0.1:8080/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"qwen-cpu\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"Classify this message as billing or technical. Reply with one label: I was charged twice.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\": 0,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 16`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Expect a successful health response after loading, `,_jsx(_components.code,{children:`qwen-cpu`}),` in the models response, and text inside `,_jsx(_components.code,{children:`choices[0].message.content`}),`. Check the label itself for correctness. The alias and endpoints follow the `,_jsx(_components.a,{href:`https://github.com/ggml-org/llama.cpp/blob/v0.4.0/tools/server/README.md`,children:`pinned server API`}),`. Keep the unauthenticated example on loopback and stop it with Ctrl+C when finished.`]}),`\n`,_jsx(Heading,{level:`2`,id:`4-find-the-cost-and-latency-boundary`,children:`4. Find the cost and latency boundary`}),`\n`,_jsx(_components.p,{children:`Replay representative requests, including longer inputs and failure cases. Compare warm and first-request latency, accepted requests per minute, and peak memory. Increase thread count one setting at a time while keeping the model, prompts, and output limits fixed. More threads can lose performance through memory contention or competition with other services.`}),`\n`,_jsx(_components.p,{children:`Compare CPU and GPU using the same task deadline and quality threshold:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`cost per accepted request =`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` total serving cost during the test window`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` / requests meeting both quality and latency requirements`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Include the full VM charge for a dedicated cloud CPU instance. For shared capacity, document its cost allocation and the impact on neighboring workloads. For owned hardware, include electricity and hardware allocation. Count retries and fallback requests. A lower hourly price can still produce a higher cost per useful result when throughput is too low.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-if-the-cpu-run-fails`,children:`What if the CPU run fails?`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Symptom`}),_jsx(_components.th,{children:`Next check`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Build cannot find a compiler`}),_jsx(_components.td,{children:`Install the platform’s compiler tools and rerun configuration.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Server cannot load the model`}),_jsx(_components.td,{children:`Check the curl exit status, file size, and exact file path.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Requests exceed context`}),_jsxs(_components.td,{children:[`Shorten the input or raise `,_jsx(_components.code,{children:`--ctx-size`}),` after checking available RAM.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Added threads make requests slower`}),_jsx(_components.td,{children:`Reduce threads and check competing load, memory bandwidth, and socket placement.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`The small model misses your quality target`}),_jsx(_components.td,{children:`Compare a larger model or higher precision before accepting a cost result.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`/guides/inference/benchmarking`,children:`benchmarking guide`}),` for a controlled comparison. On a Mac, test `,_jsx(_components.a,{href:`/guides/inference/how-to/apple-silicon-mlx`,children:`MLX on the Apple GPU`}),` separately. Read the `,_jsx(_components.a,{href:`/guides/inference/hardware/cpu-apple-silicon`,children:`CPU and Apple silicon explainer`}),` and `,_jsx(_components.a,{href:`/guides/inference/how-to/reduce-cost`,children:`inference cost checklist`}),` before selecting the next backend.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"How to run LLM inference on a CPU with llama.cpp","description":"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.","sidebarTitle":"Run an LLM on a CPU","author":"Samagra Sharma","og:type":"article","article:author":"https://samagra.me/","href":"/guides/inference/how-to/cpu-llama-cpp"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Build llama.cpp for CPU execution","slug":"1-build-llama-cpp-for-cpu-execution","depth":2,"children":[]},{"title":"2. Download one GGUF file","slug":"2-download-one-gguf-file","depth":2,"children":[]},{"title":"3. Start the server and make a request","slug":"3-start-the-server-and-make-a-request","depth":2,"children":[]},{"title":"4. Find the cost and latency boundary","slug":"4-find-the-cost-and-latency-boundary","depth":2,"children":[]},{"title":"What if the CPU run fails?","slug":"what-if-the-cpu-run-fails","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/tensorfuse-docs/c3dc9745059fca0c/warmly.js"],"subdomain":"tensorfuse-docs","siteName":"Tensorfuse","title":"How to run LLM inference on a CPU with llama.cpp - Tensorfuse","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-07T06:40:13.422Z","originalFileLocation":"guides/inference/how-to/cpu-llama-cpp.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tensorfuse\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How to run LLM inference on a CPU with llama.cpp - Tensorfuse\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tensorfuse Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tensorfuse-docs.mintlify.site/docs/_mintlify/api/og/v2?division=Inference+How-to+Guides\u0026amp;title=How+to+run+LLM+inference+on+a+CPU+with+llama.cpp\u0026amp;description=Build+a+CPU-only+llama.cpp+server%2C+download+a+small+Qwen+GGUF+model%2C+call+its+local+chat+API%2C+and+compare+useful+throughput+and+cost+with+GPU+inference.\u0026amp;theme=0d48f78dad171e209aaf92bf\u0026amp;signature=f4b4c3ff74f3663ed5e53687275aa0cb4b4495fba09529f325342447650a5f3e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"How to run LLM inference on a CPU with llama.cpp - Tensorfuse\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tensorfuse-docs.mintlify.site/docs/_mintlify/api/og/v2?division=Inference+How-to+Guides\u0026amp;title=How+to+run+LLM+inference+on+a+CPU+with+llama.cpp\u0026amp;description=Build+a+CPU-only+llama.cpp+server%2C+download+a+small+Qwen+GGUF+model%2C+call+its+local+chat+API%2C+and+compare+useful+throughput+and+cost+with+GPU+inference.\u0026amp;theme=0d48f78dad171e209aaf92bf\u0026amp;signature=f4b4c3ff74f3663ed5e53687275aa0cb4b4495fba09529f325342447650a5f3e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/tensorfuse-docs/gleo0vHV9BrLVCDe/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tensorfuse\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EC5528\">\u003clink data-mint-head rel=\"canonical\" href=\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/guides/inference/how-to/cpu-llama-cpp.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://tensorfuse.io/#organization\",\"name\":\"Tensorfuse\",\"url\":\"https://tensorfuse.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tensorfuse-docs/dmj8dBJTiBMtkrNL/logo/logoFullwidth.png?fit=max\u0026auto=format\u0026n=dmj8dBJTiBMtkrNL\u0026q=85\u0026s=055e86590676b786ef5d267c6c430d76\"}},{\"@type\":\"WebSite\",\"@id\":\"https://tensorfuse.io/docs#website\",\"name\":\"Tensorfuse\",\"url\":\"https://tensorfuse.io/docs\",\"publisher\":{\"@id\":\"https://tensorfuse.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp#webpage\",\"url\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp\",\"name\":\"How to run LLM inference on a CPU with llama.cpp\",\"description\":\"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\",\"dateModified\":\"2026-09-07T06:40:13.422Z\",\"isPartOf\":{\"@id\":\"https://tensorfuse.io/docs#website\"},\"breadcrumb\":{\"@id\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inference How-to Guides\",\"item\":\"https://tensorfuse.io/docs/guides/inference/how-to/reduce-cost\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to run LLM inference on a CPU with llama.cpp\",\"item\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp#article\",\"headline\":\"How to run LLM inference on a CPU with llama.cpp\",\"name\":\"How to run LLM inference on a CPU with llama.cpp\",\"description\":\"Build a CPU-only llama.cpp server, download a small Qwen GGUF model, call its local chat API, and compare useful throughput and cost with GPU inference.\",\"url\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp\",\"mainEntityOfPage\":{\"@id\":\"https://tensorfuse.io/docs/guides/inference/how-to/cpu-llama-cpp#webpage\"},\"dateModified\":\"2026-09-07T06:40:13.422Z\",\"publisher\":{\"@id\":\"https://tensorfuse.io/#organization\"},\"isPartOf\":{\"@id\":\"https://tensorfuse.io/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tensorfuse\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Tensorfuse","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Serverless GPU inference on AWS with Tensorfuse","sidebarTitle":"Introduction","mode":"wide","href":"/concepts/introduction"},{"title":"Getting Started","href":"/concepts/getting_started_tensorkube"}]},{"group":"LLM Inference","pages":[{"title":"Run serverless LLM inference on AWS","sidebarTitle":"Inference on AWS","href":"/guides/inference/overview"},{"title":"Choose an open model for self-hosted inference","sidebarTitle":"Choose an open model","href":"/guides/inference/open-models"},{"title":"vLLM vs SGLang: choose an LLM inference engine","sidebarTitle":"vLLM vs SGLang","href":"/guides/inference/vllm-vs-sglang"},{"title":"Benchmark LLM inference latency, throughput, and cost","sidebarTitle":"Benchmark latency and cost","href":"/guides/inference/benchmarking"},{"title":"How to enable and measure vLLM prefix caching","sidebarTitle":"Prefix caching and KV cache","href":"/guides/inference/prefix-caching"},{"title":"When does speculative decoding speed up LLM inference?","sidebarTitle":"Speculative decoding","href":"/guides/inference/speculative-decoding"}]},{"group":"Inference How-to Guides","pages":[{"title":"How to reduce LLM inference cost: a practical workflow","sidebarTitle":"Reduce inference cost","href":"/guides/inference/how-to/reduce-cost"},{"title":"How to run a 4-bit quantized LLM with vLLM","sidebarTitle":"Run a quantized LLM","href":"/guides/inference/how-to/quantization-vllm"},{"title":"How to run vLLM on AMD GPUs with ROCm","sidebarTitle":"Run vLLM on AMD GPUs","href":"/guides/inference/how-to/amd-vllm"},{"title":"How to serve LLMs on AWS Inferentia and Trainium with vLLM","sidebarTitle":"Serve LLMs with AWS Neuron","href":"/guides/inference/how-to/aws-neuron-vllm"},{"title":"How to run LLM inference on Google TPUs with vLLM","sidebarTitle":"Serve an LLM on Google TPU","href":"/guides/inference/how-to/google-tpu-vllm"},{"title":"How to run a local LLM on Apple silicon with MLX","description":"Serve a 4-bit Qwen model on your Mac with MLX LM, call its local chat API, and measure whether local inference meets your latency and cost targets.","sidebarTitle":"Run an LLM on Apple silicon","href":"/guides/inference/how-to/apple-silicon-mlx"},{"title":"How to run LLM inference on a CPU with llama.cpp","sidebarTitle":"Run an LLM on a CPU","href":"/guides/inference/how-to/cpu-llama-cpp"},{"title":"How to compare Groq, Cerebras, and SambaNova inference APIs","description":"Compare Groq, Cerebras, and SambaNova with the same task. Record API latency, token usage, errors, and correctness before comparing cost per accepted request.","sidebarTitle":"Compare specialized inference APIs","href":"/guides/inference/how-to/compare-inference-apis"}]},{"group":"Inference Hardware","pages":[{"title":"NVIDIA alternatives for LLM inference","sidebarTitle":"Choose inference hardware","href":"/guides/inference/hardware/overview"},{"title":"AMD GPU inference: understand ROCm and vLLM","sidebarTitle":"AMD GPUs and ROCm","href":"/guides/inference/hardware/amd-rocm"},{"title":"AWS Inferentia vs Trainium for LLM inference","sidebarTitle":"AWS Inferentia and Trainium","href":"/guides/inference/hardware/aws-neuron"},{"title":"TPU vs GPU for LLM inference: what changes?","sidebarTitle":"Google TPUs","href":"/guides/inference/hardware/google-tpu"},{"title":"Groq vs Cerebras vs SambaNova: inference architectures","sidebarTitle":"Groq, Cerebras, and SambaNova","href":"/guides/inference/hardware/specialized-accelerators"},{"title":"LLM inference on CPUs and Apple silicon","sidebarTitle":"CPUs and Apple silicon","href":"/guides/inference/hardware/cpu-apple-silicon"}]},{"group":"Concepts","pages":[{"title":"Deployments","href":"/concepts/deployments"},{"title":"Job Queues","href":"/concepts/job_queues"},{"title":"Fine-tune LoRA adapters with the Tensorfuse SDK","sidebarTitle":"Finetuning","href":"/concepts/finetuning"},{"title":"Dev Containers","href":"/concepts/devcontainers"},{"title":"Volumes","href":"/concepts/volumes"}]},{"group":"Operations","pages":[{"title":"Deployment Configuration","href":"/concepts/configuration"},{"title":"Secrets","href":"/concepts/secrets"},{"title":"Environments","href":"/concepts/environments"},{"title":"Custom domains with TLS","sidebarTitle":"Custom Domains","href":"/concepts/custom_domains_with_tls"},{"title":"Debugging Tensorfuse Deployments and Jobs with logs","sidebarTitle":"Logs","href":"/concepts/observability/debugging_with_logs"},{"title":"Using Tensorkube with Github Actions","sidebarTitle":"GitHub Actions","href":"/concepts/github_actions"},{"title":"Adding Other Members","href":"/concepts/adding_members"}]},{"group":"Troubleshooting","pages":[{"title":"Troubleshooting","href":"/concepts/troubleshooting"},{"title":"Handling Node Failures","href":"/concepts/node_failures"}]},{"group":"Enterprise Setup","pages":[{"title":"Sub-accounts","href":"/enterprise/sub_account_setup"}]},{"group":"Architecture","pages":[{"title":"How Tensorfuse cluster configuration works","sidebarTitle":"Configure","href":"/concepts/architecture/configure"},{"title":"How Tensorfuse builds deployment images","sidebarTitle":"Build","href":"/concepts/architecture/build"},{"title":"How Tensorfuse serves inference requests","sidebarTitle":"Serve","href":"/concepts/architecture/serve"},{"title":"How Tensorfuse queued jobs run","sidebarTitle":"Jobs","href":"/concepts/architecture/jobs"}]}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/guides/modality/text/openai_oss"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/cli_reference/tensorkube_account"}]},{"tab":"Blog","pages":[{"title":"Blog","href":"/blogs/blog"}]}]},"basePath":"","title":"How to run LLM inference on a CPU with llama.cpp - Tensorfuse","buildId":"dpl_3pZeXn3XukjzFRgAX73A7GNDfRJ1","deploymentId":"dpl_3pZeXn3XukjzFRgAX73A7GNDfRJ1","dynamics":[],"chunks":[]}