module pixeltable.functions.ollama
Pixeltable UDFs for Ollama local models. Provides integration with Ollama for running large language models locally, including chat completions and embeddings.udf chat()
Signature
messages(pxt.Json[(Json): The messages of the chat.model(Any): The model name.tools(Any): Tools for the model to use.format(Any): The format of the response; must be one of'json'orNone.options(Any): Additional options to pass to thechatcall, such asmax_tokens,temperature,top_p, andtop_k. For details, see the Valid Parameters and Values section of the Ollama documentation.
udf embed()
Signature
input(pxt.String): The input text to generate embeddings for.model(pxt.String): The model name.truncate(pxt.Bool): Truncates the end of each input to fit within context length. Returns error if false and context length is exceeded.options(pxt.Json | None): Additional options to pass to theembedcall. For details, see the Valid Parameters and Values section of the Ollama documentation.
udf generate()
Signature
prompt(pxt.String): The prompt to generate a response for.model(pxt.String): The model name.suffix(pxt.String): The text after the model response.format(Any): The format of the response; must be one of'json'orNone.system(pxt.String): System message.template(pxt.String): Prompt template to use.context(pxt.Json[(Int): The context parameter returned from a previous call togenerate().raw(Any): IfTrue, no formatting will be applied to the prompt.options(Any): Additional options for the Ollamachatcall, such asmax_tokens,temperature,top_p, andtop_k. For details, see the Valid Parameters and Values section of the Ollama documentation.