module pixeltable.functions.llama_cpp
Pixeltable UDFs for llama.cpp models. Provides integration with llama.cpp for running quantized language models locally, supporting chat completions and embeddings with GGUF format models.udf create_chat_completion()
Signature
model_path or repo_id must be provided; if model_path
is provided, then an optional repo_filename can also be specified.
For additional details, see the
llama_cpp create_chat_completion documentation.
Parameters:
messages(pxt.Json[(Json): A list of messages to generate a response for.model_path(Any): Path to the model (if using a local model).repo_id(Any): The Hugging Face model repo id (if using a pretrained model).repo_filename(Any): A filename or glob pattern to match the model file in the repo (optional, if using a pretrained model).chat_format(Any): An optional string specifying the chat format to use with the model.tools(Any): An optional list of tools (functions) the model may call, specified aspxt.func.tools.Tools.tool_choice(Any): An optionalpxt.func.tools.ToolChoicecontrolling which tool(s) the model should use.model_kwargs(Any): Additional keyword args for the llama_cppcreate_chat_completionAPI, such asmax_tokens,temperature,top_p, andtop_k. For details, see the llama_cpp create_chat_completion documentation.