ollama.create : "Client.create() got an unexpected keyword argument 'modelfile'" #209

Closed
opened 2026-02-15 16:28:46 -05:00 by yindo · 2 comments
Owner

Originally created by @adriens on GitHub (Jan 28, 2025).

About

I ran an old Notebook in which I used the following syntax :

ollama.create(model='rome-expert', modelfile=modelfile)

but since today I got the following error :

Image

It seems like thie feature has disappeared ?

📜 Source code

Whole source code is available here : OPT-NC : Acronymes genai augmentés (ollama)

# Then build the modelfile
modelfile='''FROM ''' + TARGET_MODEL + '''
SYSTEM """Tu es un expert en ressources humaines. Ta spécialité est de lier des activités ou des sujets au
référentiel des codes ROME de France Travail.

A chaque fois qu'on te pose une question tu réponds la liste des codes ROME qui sont en lien.

Réponds avec un fichier json et UNIQUEMENT avec un fichier json : n'explique pas ni ne commente.

Exemple:

Pour "Base De Données.", tu répondras avec un json valide structuré de la manière suivante et en mettant autant d'items que nécessaire,
Ci-dessous un exemple avec trois items:

[
  {
    "proposition_metier_lie": "Administrateur de bases de données",
    "rome_code_domaine_professionnel_3_chars": "M1802"
  },
  {
    "proposition_metier_lie": "Architecte système d'informtion",
    "rome_code_domaine_professionnel_3_chars": "M1802"
  },
  {
    "proposition_metier_lie": "Développeur/développeuse",
    "rome_code_domaine_professionnel_3_chars": "M1805"
  },
  ...
]
Très important : plus le json sera complet, meilleures seront les analyses produites par la suite par le data-analyste.\n\n"""
'''

# Create the model
ollama.create(model='rome-expert', modelfile=modelfile)
Originally created by @adriens on GitHub (Jan 28, 2025). # ❔ About I ran an old Notebook in which I used the following syntax : ```python ollama.create(model='rome-expert', modelfile=modelfile) ``` but since today I got the following error : ![Image](https://github.com/user-attachments/assets/7c577c0c-9d6a-4bc8-bbf7-356662290984) It seems like thie feature has disappeared ? # 📜 Source code Whole source code is available here : [OPT-NC : Acronymes genai augmentés (ollama)](https://www.kaggle.com/code/adriensales/opt-nc-acronymes-genai-augment-s-ollama?scriptVersionId=219678216) ```python # Then build the modelfile modelfile='''FROM ''' + TARGET_MODEL + ''' SYSTEM """Tu es un expert en ressources humaines. Ta spécialité est de lier des activités ou des sujets au référentiel des codes ROME de France Travail. A chaque fois qu'on te pose une question tu réponds la liste des codes ROME qui sont en lien. Réponds avec un fichier json et UNIQUEMENT avec un fichier json : n'explique pas ni ne commente. Exemple: Pour "Base De Données.", tu répondras avec un json valide structuré de la manière suivante et en mettant autant d'items que nécessaire, Ci-dessous un exemple avec trois items: [ { "proposition_metier_lie": "Administrateur de bases de données", "rome_code_domaine_professionnel_3_chars": "M1802" }, { "proposition_metier_lie": "Architecte système d'informtion", "rome_code_domaine_professionnel_3_chars": "M1802" }, { "proposition_metier_lie": "Développeur/développeuse", "rome_code_domaine_professionnel_3_chars": "M1805" }, ... ] Très important : plus le json sera complet, meilleures seront les analyses produites par la suite par le data-analyste.\n\n""" ''' # Create the model ollama.create(model='rome-expert', modelfile=modelfile) ```
yindo closed this issue 2026-02-15 16:28:46 -05:00
Author
Owner

@ParthSareen commented on GitHub (Jan 28, 2025):

Hey! Yes the API changed - you can find updated docs here: https://github.com/ollama/ollama/blob/2ef3c803a151a0a9b1776c9ebe6a7e86b3971660/docs/api.md#create-a-model-from-gguf

Sorry about the breaking change!

@ParthSareen commented on GitHub (Jan 28, 2025): Hey! Yes the API changed - you can find updated docs here: https://github.com/ollama/ollama/blob/2ef3c803a151a0a9b1776c9ebe6a7e86b3971660/docs/api.md#create-a-model-from-gguf Sorry about the breaking change!
Author
Owner

@adriens commented on GitHub (Jan 28, 2025):

Hi @ParthSareen : yup, API changed, but how has it ben wrapped within ollama-python I mean through SDK calls ? Could you point me doc to achieve a model creation from a model file ? 🙏

@adriens commented on GitHub (Jan 28, 2025): Hi @ParthSareen : yup, API changed, but how has it ben wrapped within `ollama-python` I mean through SDK calls ? Could you point me doc to achieve a model creation from a model file ? 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#209