# Latest llama.cpp won't build in Spaces

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357%3E%5C
**Category:** Spaces\
**Created:** [August 11, 2025, 12:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357 "2025-08-11T00:41:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david-thrower](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@david-thrower](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdavid-thrower)%5C
**Post date:** [August 11, 2025, 12:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357%2F1 "2025-08-11T00:41:02Z")

</div>

## I have the requirements (CPU Upgrade instance):

```auto

cmake==4.0.3
llama_cpp_python==0.3.15
gradio==5.34.2
pypdf==5.9.0
python-docx==1.2.0
pandas==2.3.0

```

When this space builds: [3B Param Basic Chatbot - a Hugging Face Space by david-thrower](https://huggingface.co/spaces/david-thrower/3B-Param-Basic-Chatbot) , the space will get “stuck“ building the wheel for llama.cpp without any feedback in the logs on what is going on:

```auto

Building wheels for collected packages: llama_cpp_python
  Building wheel for llama_cpp_python (pyproject.toml): started
# ... never prints another line then a "build error" with no further info 

```

I have tried numerous attempts to troubleshoot this:

1. Adding `cmake==4.0.3` to the requirements.
2. Setting the environment variables: FORCE\_CMAKE=1; CMAKE\_ARGS=”-DLLAMA\_OPENBLAS=on”'; PIP\_NO\_CACHE\_DIR=1
3. Nothing seems to fix the problem

The is working like a charm on my laptop (albeit building that wheel did take a few minutes).

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [August 11, 2025, 2:01am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357%2F2 "2025-08-11T02:01:35Z")

</div>

I tried it as a last resort, and it worked.

### `app.py`

```py
import subprocess
subprocess.run("pip install -V llama_cpp_python==0.3.15", shell=True)

...

```

### `requirements.txt`

```py
#cmake==4.0.3
#llama_cpp_python==0.3.15
#gradio==5.34.2
pypdf==5.9.0
python-docx==1.2.0
pandas==2.3.0

```

---

<div class="post-metadata">

**Author:** ![iam-tsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/iam-tsr/32/54346_2.png) [@iam-tsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fiam-tsr)%5C
**Post date:** [January 28, 2026, 7:00pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357%2F3 "2026-01-28T19:00:09Z")

</div>

I don’t know, how it is working for you but I am also facing this issue.

logs:

```auto
Collecting llama_cpp_python==0.3.15
  Downloading llama_cpp_python-0.3.15.tar.gz (50.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.6/50.6 MB 68.6 MB/s 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: typing-extensions>=4.5.0 in /usr/local/lib/python3.13/site-packages (from llama_cpp_python==0.3.15) (4.15.0)
Requirement already satisfied: numpy>=1.20.0 in /usr/local/lib/python3.13/site-packages (from llama_cpp_python==0.3.15) (2.4.1)
Collecting diskcache>=5.6.1 (from llama_cpp_python==0.3.15)
  Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Requirement already satisfied: jinja2>=2.11.3 in /usr/local/lib/python3.13/site-packages (from llama_cpp_python==0.3.15) (3.1.6)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.13/site-packages (from jinja2>=2.11.3->llama_cpp_python==0.3.15) (3.0.3)
Downloading diskcache-5.6.3-py3-none-any.whl (45 kB)
Building wheels for collected packages: llama_cpp_python
  Building wheel for llama_cpp_python (pyproject.toml): started
  Building wheel for llama_cpp_python (pyproject.toml): still running...

# No progress after this

```

**app.py**

`import subprocess`  
`subprocess.run("pip install -V llama_cpp_python==0.3.15", shell=True)`  
`print("Hello")`

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 29, 2026, 2:42am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flatest-llama-cpp-wont-build-in-spaces%2F166357%2F4 "2026-01-29T02:42:24Z")

</div>

There are cases where that method doesn’t work. [In those cases, the most reliable approach is to fork GitHub yourself, create a build wheel, and publish it (though you can certainly use a build wheel created by someone else)](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-llama-cpp-on-spaces%2F172216%2F2). But it’s a real pain…
