issue: Workspace > Models: import of single model not working without response #4597

Closed
opened 2025-11-11 15:58:07 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @MaxStroh on GitHub (Mar 28, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Other

Open WebUI Version

v0.5.20

Ollama Version (if applicable)

No response

Operating System

Kubernetes / Ubuntu

Browser (if applicable)

Chrome 134.0.6998.166, Firefox 136.0.4

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

  • When exporting a single model from workspace > models I would expect to be able to import this single model again on another instance (e.g. staging / prod environment)
  • When the import of a model json file fails I would like to get a dedicated exception

Actual Behavior

  • Exporting a single model via Workspace > Models > "More" / "Three dots"-Button on a single model > Export downloads a (seemingly) valid model JSON file
  • When importing the model JSON file on another instance via the Workspace > Models > "Import Models"-Button on the right of the page, I get some logs in the browser console, logging the model included in the JSON file, but then nothing happens
  • No error message, no error log in the browser console - simply nothing is happening
  • Even in the running pod there are no logs about the failed import

Steps to Reproduce

  1. Go to 'Workspace' > 'Models'
  2. If no custom model exists, create a new demo model (settings are irrelevant, breaks with any settings)
  3. Save the newly created model
  4. On any existing model on 'Workspace' > 'Models' click on the "three dots"-Button (Tooltip labeled with "More")
  5. Click on "Export" and save the json file
  6. On the page 'Workspace' > 'Models' click on the 'Import models' button in the bottom right
  7. Choose the downloaded json file from earlier and confirm
  8. Inspect the browser console if you want

Logs & Screenshots

Export single model:
Image

Import JSON file:
Image

Browser Logs:
Image

Additional Information

  • When looking into the code and comparing to the json file downloaded when exporting ALL models via the button on the bottom right on the 'Workspace' > 'Models' page I think the models json file of the single model is missing an encapsulation into an "info" field.
  • In the all models json file, there are all model details and attributes (including the custom models created via 'Workspace' > 'Models') encapsuled in an "info" field like this:
[
  // ... other models here...
  {
    "id": "demo-model",
    "name": "Demo Model",
    "object": "model",
    "created": 1743178699,
    "owned_by": "openai",
    "info": {
      "id": "demo-model",
      "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87",
      "base_model_id": "azure-gpt-4o-mini",
      "name": "Demo Model",
      "params": {
        "system": "Answer politely"
      },
      "meta": {
        "profile_image_url": "/static/favicon.png",
        "description": "Demo description",
        "capabilities": {
          "vision": true,
          "usage": false,
          "citations": true
        },
        "suggestion_prompts": null,
        "tags": []
      },
      "access_control": null,
      "is_active": true,
      "updated_at": 1743178699,
      "created_at": 1743178699
    },
    "preset": true,
    "actions": []
  }
]
  • The single model export file is missing this attribute "info":
[
  {
    "id": "demo-model",
    "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87",
    "base_model_id": "azure-gpt-4o-mini",
    "name": "Demo Model",
    "params": {
      "system": "Answer politely"
    },
    "meta": {
      "profile_image_url": "/static/favicon.png",
      "description": "Demo description",
      "capabilities": {
        "vision": true,
        "usage": false,
        "citations": true
      },
      "suggestion_prompts": null,
      "tags": []
    },
    "access_control": null,
    "is_active": true,
    "updated_at": 1743178699,
    "created_at": 1743178699,
    "user": {
      "id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87",
      "name": "Test User",
      "email": "test@example.com",
      "role": "admin",
      "profile_image_url": "/user.png"
    }
  }
]
  • Also, I found the following code snippet in the code, which was a hint, why the single exported model file is not working:
    b03fc97e28/src/lib/components/workspace/Models.svelte (L420-L434)

  • So my suggestion is, that inside the for loop, it is looked for a field named "info", if it is missing - simply nothing is done, the content of the model config is skipped and nothing happens

  • So I thought "what if I just wrap the whole content of the single exported json file inside a field named "info" - et voilà: it worked! I was able to import the following single-model-file via the 'Workspace' > 'Models' > 'Import models' button without any errors:

[
  {
    "info": {
      "id": "demo-model",
      "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87",
      "base_model_id": "azure-gpt-4o-mini",
      "name": "Demo Model",
      "params": {
        "system": "Answer politely"
      },
      "meta": {
        "profile_image_url": "/static/favicon.png",
        "description": "Demo description",
        "capabilities": {
          "vision": true,
          "usage": false,
          "citations": true
        },
        "suggestion_prompts": null,
        "tags": []
      },
      "access_control": null,
      "is_active": true,
      "updated_at": 1743178699,
      "created_at": 1743178699,
      "user": {
        "id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87",
        "name": "Test User",
        "email": "test@example.com",
        "role": "admin",
        "profile_image_url": "/user.png"
      }
    }
  }
]
  • So my suggestion would be: When exporting a single model, wrap the config into an "info" field and export this as json
  • Or: Modify the if clause in the code to not only check, if the file includes an "info" field, but instead check otherwise, whether the file includes a model configuration

Short disclaimer:

  • We have OpenWebUI deployed and running on a kubernetes cluster inside a pod. So unfortunately I did not test this locally (but depending on the code, this should also appear locally on Docker)
  • The logs of the pod did log exactly nothing during this time, so I did not include these
  • We do not use Ollama, but also this should not be a problem of the base model imo

Exported single model json file (not working):
demo-model-1743179018399.json

Export all models json file (working, but includes all models):
models-export-1743179408340.json

Modified (and able to import) single model json file:
modified-demo-model.json

Originally created by @MaxStroh on GitHub (Mar 28, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Other ### Open WebUI Version v0.5.20 ### Ollama Version (if applicable) _No response_ ### Operating System Kubernetes / Ubuntu ### Browser (if applicable) Chrome 134.0.6998.166, Firefox 136.0.4 ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior * When exporting a single model from workspace > models I would expect to be able to import this single model again on another instance (e.g. staging / prod environment) * When the import of a model json file fails I would like to get a dedicated exception ### Actual Behavior * Exporting a single model via Workspace > Models > "More" / "Three dots"-Button on a single model > Export downloads a (seemingly) valid model JSON file * When importing the model JSON file on another instance via the Workspace > Models > "Import Models"-Button on the right of the page, I get some logs in the browser console, logging the model included in the JSON file, but then nothing happens * No error message, no error log in the browser console - simply nothing is happening * Even in the running pod there are no logs about the failed import ### Steps to Reproduce 1. Go to 'Workspace' > 'Models' 2. If no custom model exists, create a new demo model (settings are irrelevant, breaks with any settings) 3. Save the newly created model 4. On any existing model on 'Workspace' > 'Models' click on the "three dots"-Button (Tooltip labeled with "More") 5. Click on "Export" and save the json file 6. On the page 'Workspace' > 'Models' click on the 'Import models' button in the bottom right 7. Choose the downloaded json file from earlier and confirm 8. Inspect the browser console if you want ### Logs & Screenshots Export single model: <img width="968" alt="Image" src="https://github.com/user-attachments/assets/6df69eff-c66a-46c4-b6bd-82e2261e34de" /> Import JSON file: <img width="1702" alt="Image" src="https://github.com/user-attachments/assets/7d968708-c4a1-47f7-9f8d-b61a29653aef" /> Browser Logs: <img width="1641" alt="Image" src="https://github.com/user-attachments/assets/5627800f-8df3-4d30-903c-7d071fe07d9b" /> ### Additional Information * When looking into the code and comparing to the json file downloaded when exporting ALL models via the button on the bottom right on the 'Workspace' > 'Models' page I think the models json file of the single model is missing an encapsulation into an "info" field. * In the all models json file, there are all model details and attributes (including the custom models created via 'Workspace' > 'Models') encapsuled in an "info" field like this: ``` json [ // ... other models here... { "id": "demo-model", "name": "Demo Model", "object": "model", "created": 1743178699, "owned_by": "openai", "info": { "id": "demo-model", "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87", "base_model_id": "azure-gpt-4o-mini", "name": "Demo Model", "params": { "system": "Answer politely" }, "meta": { "profile_image_url": "/static/favicon.png", "description": "Demo description", "capabilities": { "vision": true, "usage": false, "citations": true }, "suggestion_prompts": null, "tags": [] }, "access_control": null, "is_active": true, "updated_at": 1743178699, "created_at": 1743178699 }, "preset": true, "actions": [] } ] ``` * The single model export file is missing this attribute "info": ``` json [ { "id": "demo-model", "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87", "base_model_id": "azure-gpt-4o-mini", "name": "Demo Model", "params": { "system": "Answer politely" }, "meta": { "profile_image_url": "/static/favicon.png", "description": "Demo description", "capabilities": { "vision": true, "usage": false, "citations": true }, "suggestion_prompts": null, "tags": [] }, "access_control": null, "is_active": true, "updated_at": 1743178699, "created_at": 1743178699, "user": { "id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87", "name": "Test User", "email": "test@example.com", "role": "admin", "profile_image_url": "/user.png" } } ] ``` * Also, I found the following code snippet in the code, which was a hint, why the single exported model file is not working: https://github.com/open-webui/open-webui/blob/b03fc97e287f31ad07bda896143959bc4413f7d2/src/lib/components/workspace/Models.svelte#L420-L434 * So my suggestion is, that inside the for loop, it is looked for a field named "info", if it is missing - simply nothing is done, the content of the model config is skipped and nothing happens * So I thought "what if I just wrap the whole content of the single exported json file inside a field named "info" - et voilà: it worked! I was able to import the following single-model-file via the 'Workspace' > 'Models' > 'Import models' button without any errors: ```json [ { "info": { "id": "demo-model", "user_id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87", "base_model_id": "azure-gpt-4o-mini", "name": "Demo Model", "params": { "system": "Answer politely" }, "meta": { "profile_image_url": "/static/favicon.png", "description": "Demo description", "capabilities": { "vision": true, "usage": false, "citations": true }, "suggestion_prompts": null, "tags": [] }, "access_control": null, "is_active": true, "updated_at": 1743178699, "created_at": 1743178699, "user": { "id": "73ae4aa4-b7df-4bcc-abb7-7b86d6480b87", "name": "Test User", "email": "test@example.com", "role": "admin", "profile_image_url": "/user.png" } } } ] ``` * So my suggestion would be: When exporting a single model, wrap the config into an "info" field and export this as json * Or: Modify the if clause in the code to not only check, if the file includes an "info" field, but instead check otherwise, whether the file includes a model configuration --- Short disclaimer: * We have OpenWebUI deployed and running on a kubernetes cluster inside a pod. So unfortunately I did not test this locally (but depending on the code, this should also appear locally on Docker) * The logs of the pod did log exactly nothing during this time, so I did not include these * We do not use Ollama, but also this should not be a problem of the base model imo --- Exported single model json file (not working): [demo-model-1743179018399.json](https://github.com/user-attachments/files/19509168/demo-model-1743179018399.json) Export all models json file (working, but includes all models): [models-export-1743179408340.json](https://github.com/user-attachments/files/19509187/models-export-1743179408340.json) Modified (and able to import) single model json file: [modified-demo-model.json](https://github.com/user-attachments/files/19509403/modified-demo-model.json)
GiteaMirror added the bug label 2025-11-11 15:58:07 -06:00
Author
Owner

@tjbck commented on GitHub (Mar 29, 2025):

PR Welcome!

@tjbck commented on GitHub (Mar 29, 2025): PR Welcome!
Author
Owner

@tjbck commented on GitHub (Mar 31, 2025):

Addressed with 300b7dfcc0

@tjbck commented on GitHub (Mar 31, 2025): Addressed with 300b7dfcc083495e230470186a41f1d0e5cbec4a
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4597