Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt

Use this file to discover all available pages before exploring further.

module  pixeltable.functions.fireworks

Pixeltable UDFs that wrap various endpoints from the Fireworks AI API. In order to use them, you must first pip install fireworks-ai and configure your Fireworks AI credentials, as described in the Working with Fireworks tutorial.

udf  chat_completions()

Signature
@pxt.udf
chat_completions(
    messages: pxt.Json,
    *,
    model: pxt.String,
    model_kwargs: pxt.Json | None = None
) -> pxt.Json
Creates a model response for the given chat conversation. Equivalent to the Fireworks AI chat/completions API endpoint. For additional details, see: https://docs.fireworks.ai/api-reference/post-chatcompletions Request throttling: Applies the rate limit set in the config (section fireworks, key rate_limit). If no rate limit is configured, uses a default of 600 RPM. Requirements:
  • pip install fireworks-ai
Parameters:
  • messages (pxt.Json): A list of messages comprising the conversation so far.
  • model (pxt.String): The name of the model to use.
  • model_kwargs (pxt.Json | None): Additional keyword args for the Fireworks chat_completions API. For details on the available parameters, see: https://docs.fireworks.ai/api-reference/post-chatcompletions
Returns:
  • pxt.Json: A dictionary containing the response and other metadata.
Examples: Add a computed column that applies the model accounts/fireworks/models/mixtral-8x22b-instruct to an existing Pixeltable column tbl.prompt of the table tbl:
messages = [{'role': 'user', 'content': tbl.prompt}]
tbl.add_computed_column(
    response=chat_completions(
        messages, model='accounts/fireworks/models/mixtral-8x22b-instruct'
    )
)
Last modified on May 1, 2026