Skip to main content

Language Models Tools

Spice provides tools that help LLMs interact with the runtime. To specify these tools for a Spice model, include them in its params.tools.

For a list of available tools, or how to define additional tools, see Tool Components.

Example: Specifying Tools for a Model​

models:
- name: sql-model
from: openai:gpt-4o
params:
tools: list_datasets, sql, table_schema

Example: Specifying tools via a Tool Group​

  - name: full-runtime
from: openai:gpt-4o
params:
tools: auto # Use all default tools

For details on tool groups, see Tool Components.

Example: Specifying tools and tool groups​

models:
- name: full-runtime
from: openai:gpt-4o
params:
tools: memory, sql

Tool Recursion Limit​

When a model requests to call a runtime tool, Spice runs the tool internally and feeds it back to the model. The tool_recursion_limit parameter limits the depth of internal recursion Spice will undertake. By default, Spice can infinitely recurse if the model requests to do so.

models:
- name: my-model
from: openai
params:
tool_recursion_limit: 3