Documentation Index
Fetch the complete documentation index at: https://togetherai-migration.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Certain models support function calling (also called tool calling), which gives them the ability to respond to queries with function names and arguments that you can then invoke in your own application code. To use it, pass an array of function descriptions to thetools key. If the LLM decides one or more of the available functions should be used to answer a query, it will respond with an array of the function names and their arguments to call in the tool_calls key of its response.
You can then use the data from tool_calls to invoke the named functions and get the results, which you can then provide directly to the user or pass them back into subsequent LLM queries for further processing.
Supported models
The following models currently support function calling:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8meta-llama/Llama-4-Scout-17B-16E-Instructmeta-llama/Meta-Llama-3.1-8B-Instruct-Turbometa-llama/Meta-Llama-3.1-70B-Instruct-Turbometa-llama/Meta-Llama-3.1-405B-Instruct-Turbometa-llama/Llama-3.3-70B-Instruct-Turbometa-llama/Llama-3.2-3B-Instruct-TurboQwen/Qwen2.5-7B-Instruct-TurboQwen/Qwen2.5-72B-Instruct-TurboQwen/Qwen3-235B-A22B-fp8-tputdeepseek-ai/DeepSeek-V3mistralai/Mistral-Small-24B-Instruct-2501
Basic example
Letβs say our application has access to aget_current_weather function which takes in two named arguments,location and unit:
tools key alongside the userβs query. Letβs suppose the user asks, βWhat is the current temperature of New York, San Francisco and Chicago?β
tool_calls key of the LLMβs response will look like this:
Selecting a specific tool
By default, an LLM thatβs been provided withtools will automatically attempt to use the most appropriate one when generating responses.
If youβd like to manually select a specific tool to use for a completion, pass in the toolβs name to the tool_choice parameter: