Skip to content

Use llama serve in Jobs serving guide (llama.cpp unified CLI)#2593

Merged
davanstrien merged 2 commits into
huggingface:mainfrom
davanstrien:jobs-serving-llama-serve
Jun 30, 2026
Merged

Use llama serve in Jobs serving guide (llama.cpp unified CLI)#2593
davanstrien merged 2 commits into
huggingface:mainfrom
davanstrien:jobs-serving-llama-serve

Conversation

@davanstrien

@davanstrien davanstrien commented Jun 24, 2026

Copy link
Copy Markdown
Member

Follow-up to #2554 addressing @julien-c's review feedback: push the new unified llama serve command instead of the standalone llama-server.

What changed

The llama.cpp section now uses llama serve on the full-cuda image (both the -hf example and the volume-mount tip), with the surrounding prose and warning updated to match.

Why the image also changed

llama serve and llama-server are the same server — the unified llama CLI (ggml-org/llama.cpp#23875, "git commit vs git-commit"). But the unified llama binary only ships in the full-cuda image; server-cuda contains only /app/llama-server. So using llama serve requires full-cuda — a ~1 GB larger pull (3.6 GB vs 2.6 GB compressed). Startup is dominated by the model download/load, which is unchanged, so the "a few minutes" framing still holds.

Tested

Ran on live Jobs (full-cuda + a10g-small):

  • llama serve -hf ggml-org/gemma-4-E4B-it-GGUF --host 0.0.0.0 --port 8080 -ngl 99 → server reached ready, returned a completion through the exposed-port proxy with a Bearer token.
  • The volume-mounted --model /model/...gguf variant → ready in ~40s (nothing to download), completion returned.

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only wording and example command updates with no runtime or security impact.

Overview
Updates the Serve GGUF models with llama.cpp section in jobs-serving.md to document llama.cpp’s unified llama serve entry point instead of the standalone llama-server.

Prose, the main -hf job example, the volume-mount tip, and the 0.0.0.0 warning now refer to llama serve and use /app/llama serve in the sample commands; server flags and the ghcr.io/ggml-org/llama.cpp:server-cuda image tag in the snippets are unchanged in this diff.

Reviewed by Cursor Bugbot for commit 3f9c7ac. Bugbot is set up for automated code reviews on this repo. Configure here.

Switches the llama.cpp section of the Jobs serving guide from the
standalone `llama-server` binary to the unified `llama serve` command,
per review feedback on huggingface#2554.

`llama serve` and `llama-server` are the same server (the unified
`llama` CLI, ggml-org/llama.cpp#23875). The unified binary ships in the
`full-cuda` image; the `server-cuda` image only contains
`/app/llama-server`, so the image changes too.

Tested on live Jobs (full-cuda + a10g-small): both the `-hf` and the
volume-mounted `--model` forms reached ready and returned completions
through the exposed-port proxy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread docs/hub/jobs-serving.md Outdated
Comment on lines +71 to +72
... ghcr.io/ggml-org/llama.cpp:full-cuda -- \
... /app/llama serve -hf ggml-org/gemma-4-E4B-it-GGUF \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just verified it and the llama binary is indeed included in the full-cuda image (6.58 GB in my system) but not in the server-cuda one (4.35 GB). I wonder if we should include llama in server builds as well (but not all the other binaries/utilities that come with the full package).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angt makes sense to add it to server-cuda builds?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go llama everywhere by default then ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will hold off merging this for now to switch back to the lighter image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this particular use case (optimized server image), I'd include the same stuff we do now, but also a llama binary if that's possible. So calling llama serve will work, it's ok that llama cli doesn't, imo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go llama everywhere by default then ?

Forgot it was already enabled by default 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check if it's in the latest server-cuda images?

…ama.cpp#25035)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davanstrien

Copy link
Copy Markdown
Member Author

llama is in the latest server-cuda

Verified directly by running the latest image on a Job:

$ hf jobs run --flavor cpu-basic ghcr.io/ggml-org/llama.cpp:server-cuda \
    sh -c "ls -la /app/llama && /app/llama --version"

Switched back to the server image. IMO can merge now?

@davanstrien
davanstrien merged commit cad45fc into huggingface:main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants