openai.NotFoundError: Error code 404, python cant find assistant

The first question is if you are using chat.completions or the assistants API. Then, if you have ensured the API key (typically set as environment variable OPENAI_API_KEY) is one for the training organization.

Then the model name. The ability to use fine-tuning models in assistants has only just been enabled. The only model that they will allow is gpt-3.5-turbo-0125, however.

You can list your fine tune models with this endpoint Python script I wrote up that shows all fine-tunes, and then for you, only those compatible with assistants, using the latest openai Python module. That will show you your true model name with created date if it is ready for use.

from typing import List, Optional
from openai import OpenAI
import datetime
import locale

def filter_models(starts_with: Optional[List[str]] = ["gpt", "ft:gpt"], blacklist: Optional[List[str]] = ["instruct"]) -> List[tuple]:
    """
    Fetches and filters model names and creation dates from the OpenAI API based on specified criteria.
    
    Parameters:
        starts_with (List[str]): A list of prefixes to include models that start with any of them.
        blacklist (List[str]): A list of substrings to exclude models that contain any of them.
    
    Returns:
        List[tuple]: A list of filtered model tuples (model name, creation date) that meet the criteria.
    """
    client = OpenAI()
    try:
        model_obj = client.models.list()  # API call
    except Exception as err:
        raise ValueError(f"Model listing API call failed: {err}") from None
    
    model_list = sorted([(model.id, model.created) for model in model_obj.data], key=lambda x: x[0])

    def starts_with_any(model_tuple: tuple, starts_with_list: List[str]) -> bool:
        return any(model_tuple[0].startswith(prefix) for prefix in starts_with_list)

    def contains_blacklisted(model_tuple: tuple, blacklist: List[str]) -> bool:
        return any(blacklisted in model_tuple[0] for blacklisted in blacklist)

    filtered_models = [model for model in model_list
                       if starts_with_any(model, starts_with)
                       and not contains_blacklisted(model, blacklist)]

    return filtered_models

locale.setlocale(locale.LC_ALL, '')

default_filtered_models = filter_models(["ft:"])
print("-- All fine-tune models --")
if default_filtered_models:
    print("\n".join(f"{model[0]}, Created: {datetime.datetime.fromtimestamp(model[1]).strftime('%c')}" for model in default_filtered_models))
else:
    print("No models meeting criteria")

default_filtered_models = filter_models(["ft:gpt-3.5-turbo-0125"])
print("-- Fine-tune models compatible with Assistants --")
if default_filtered_models:
    print("\n".join(f"{model[0]}, Created: {datetime.datetime.fromtimestamp(model[1]).strftime('%c')}" for model in default_filtered_models))
else:
    print("No models meeting criteria")

Example output:

-- All fine-tune models --
ft:gpt-3.5-turbo-0613:my_org::83govGjy, Created: 9/28/2023 1:37:58 AM
ft:gpt-3.5-turbo-1106:my_org::8IkEWw8r, Created: 11/8/2023 1:18:36 PM
-- Fine-tune models compatible with Assistants --
No models meeting criteria

The date should be localized for you.

Happy bot chat!