#fine tuned model for assistant api

1 messages · Page 1 of 1 (latest)

inner parrot
#

Can we attach fine tuned model with assistant api #dev-chat

empty lintelBOT
#

Hi @inner parrot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, you can use fine-tuned models with the Assistants API. However, as of the latest update in April 2024, only fine-tuned versions of gpt-3.5-turbo-0125 are supported. This means you can fine-tune this specific model and then use it with the Assistants API.

Here's an example of how you might use a fine-tuned model with the API, based on the information provided in the knowledge sources:

from openai import OpenAI
client = OpenAI()

completion = client.chat.completions.create(
    model=model_id,  # replace with your fine-tuned model's ID
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"},
        {"role": "assistant", "content": "Hi, how can I help you today?"},
        {
            "role": "user",
            "content": "Can you answer the following question based on the given context? If not, say, I don't know:\n\nQuestion: What is the capital of France?\n\nContext: The capital of Mars is Gaia. Answer:",
        },
    ],
)

print(completion.choices[0].message)

Please note that the model ID (model_id) should be replaced with the ID of your fine-tuned model. Also, the messages in the messages list should be replaced with the actual conversation you want to have with the assistant.

For more information on fine-tuning models and using them with the Assistants API, you can refer to the fine-tuning guide (https://platform.openai.com/docs/guides/fine-tuning) and the Assistants API documentation (https://platform.openai.com/docs/assistants/whats-new).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@inner parrot kapa.ai is still learning and improving, please let us know how it did by reacting below

inner parrot
#

Thx. Can you provide a comprehensive template for assistant api agent ?