Support passing grammars to server on the command line.

Open Beginner friendly
#636 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
backend, cli

Research direction

Look at the server entry point, likely in llama_cpp/server.py or a similar module. Examine how command-line arguments are parsed (e.g., using argparse) and how they are passed to the underlying llama.cpp server logic. Compare with the existing llama.cpp command-line interface to understand how the --grammar parameter should be integrated. Test by running the server with the new argument to ensure it accepts and passes the grammar correctly.

Written by the indexing model from the issue text.

Description

enhancement

Is your feature request related to a problem? Please describe.

The python3 -m llama_cpp.server command doesn't have a parameter to pass along a grammar the same way llama.cpp does.

Describe the solution you'd like

A --grammar command line parameter for the server.

Thanks!!

Dominant language
Python
Stars
10.6k
Forks
1.5k
Avg merge
23m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from abetlen/llama-cpp-python

All issues in abetlen/llama-cpp-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.