The llama-cpp-agent framework is a tool designed for easy interaction with Large Language Models (LLMs). Allowing users to chat with LLM models, execute structured function calls and get structured output. Works also with models not fine-tuned to JSON output and function calls.
Other
472
stars
42
forks
source link
Does llama-cpp-agent support prefix or other regular expression features ? #39
I see a project like llama-cpp-agent, named outlines
I try the demo by use
import outlines
model = outlines.models.llamacpp(
"svjack/mistral-7b",
"mistral-7b-instruct-v0.2.Q4_0.gguf",
verbose=False,
n_gpu_layers = -1,
n_ctx = 3060
)
prompt = "What is the IP address of the Google DNS servers? "
generator = outlines.generate.regex(
model,
r"(The IP address of Google DNS servers in digits is :\s[0-9+].[0-9+].[0-9+].[0-9+])",
)
structured = generator(prompt, max_tokens=30)
print(structured)
The output is
The IP address of Google DNS servers in digits is :
8.8.8.8
It use regex to match the output, Does this can do in llama-cpp-agent.
If this can be done. can I use unicode unicode wildcard such as
I see a project like llama-cpp-agent, named outlines I try the demo by use
The output is
It use regex to match the output, Does this can do in llama-cpp-agent.
If this can be done. can I use unicode unicode wildcard such as
to match them with the help of llama-cpp-python ?