Skip to main content
Together retired the source’s meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo serverless model. Select a current chat model marked for function calling in the Together serverless catalog before running. See Together function calling.
tool_use.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Use a function-calling model

Add import os, then replace Together(id="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo") with Together(id=os.environ["TOGETHER_TOOL_MODEL_ID"]) in the saved file.
5

Run the example

Save the code above as tool_use.py, then run:
Full source: cookbook/90_models/together/tool_use.py