Cannot add model to OpenAI-API-compatible #797

Closed
opened 2026-02-16 10:20:32 -05:00 by yindo · 4 comments
Owner

Originally created by @simpsonyang on GitHub (Nov 11, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.2

Plugin version

0.0.24

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I add models to OpenAI-API-compatible, but there is no model list under it.
I get the error log from docker.
,

✔️ Error log

2025-11-11 13:19:34.091 INFO [Dummy-5022] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:35.477 INFO [Dummy-5022] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/dispatch/model/validate_model_credentials "HTTP/1.1 200 OK"
2025-11-11 13:19:35.670 INFO [Dummy-5023] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.071 INFO [Dummy-5024] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.116 INFO [Dummy-5025] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.118 INFO [Dummy-5026] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.154 INFO [Dummy-5027] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.156 INFO [Dummy-5028] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK"
2025-11-11 13:19:36.644 INFO [Dummy-5027] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/dispatch/model/schema "HTTP/1.1 200 OK"
2025-11-11 13:19:36.646 ERROR [Dummy-5027] [base.py:271] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\"args\":{},\"error_type\":\"ValueError\",\"message\":\"invalid literal for int() with base 10: '131,072'\"}","error_type":"PluginInvokeError","args":null}', 'data': None}
2025-11-11 13:19:36.647 WARNING [Dummy-5027] [provider_configuration.py:1737] - get custom model schema failed, req_id: 1fa8c2df71 PluginInvokeError: {"args":{},"error_type":"ValueError","message":"invalid literal for int() with base 10: '131,072'"}

Originally created by @simpsonyang on GitHub (Nov 11, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.2 ### Plugin version 0.0.24 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I add models to OpenAI-API-compatible, but there is no model list under it. I get the error log from docker. , ### ✔️ Error log 2025-11-11 13:19:34.091 INFO [Dummy-5022] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:35.477 INFO [Dummy-5022] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/dispatch/model/validate_model_credentials "HTTP/1.1 200 OK" 2025-11-11 13:19:35.670 INFO [Dummy-5023] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.071 INFO [Dummy-5024] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.116 INFO [Dummy-5025] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.118 INFO [Dummy-5026] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.154 INFO [Dummy-5027] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.156 INFO [Dummy-5028] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/management/models?page=1&page_size=256 "HTTP/1.1 200 OK" 2025-11-11 13:19:36.644 INFO [Dummy-5027] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/97098ea7-f8e8-4ba4-a25b-bb1d22ccc1ec/dispatch/model/schema "HTTP/1.1 200 OK" 2025-11-11 13:19:36.646 ERROR [Dummy-5027] [base.py:271] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"ValueError\\",\\"message\\":\\"invalid literal for int() with base 10: \'131,072\'\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} 2025-11-11 13:19:36.647 WARNING [Dummy-5027] [provider_configuration.py:1737] - get custom model schema failed, req_id: 1fa8c2df71 PluginInvokeError: {"args":{},"error_type":"ValueError","message":"invalid literal for int() with base 10: '131,072'"}
yindo added the bug label 2026-02-16 10:20:32 -05:00
yindo closed this issue 2026-02-16 10:20:32 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 11, 2025):

The error happens because the Dify core tries to convert a string like '131,072' (with a comma) to an integer, but Python's int() can't handle commas. This parsing isn't handled in the plugin code—it happens in the main Dify server when it validates model schemas or credentials. There’s currently no sanitization to strip commas before conversion, so any numeric field with a thousands separator will trigger this bug.

Recent Dify updates have added some sanitization for complex default values in plugin parameters, but not specifically for numbers with commas. To avoid this error, make sure any numeric values in your model configuration are plain numbers (e.g., 131072 instead of '131,072'). If you control the schema or config, remove any formatting from numeric fields before submitting them to Dify.

This issue should ideally be fixed in the Dify core by sanitizing numeric inputs before parsing. For now, manual cleanup of number formatting is the best workaround.

Reference:

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 11, 2025): <!-- Answer --> The error happens because the Dify core tries to convert a string like `'131,072'` (with a comma) to an integer, but Python's `int()` can't handle commas. This parsing isn't handled in the plugin code—it happens in the main Dify server when it validates model schemas or credentials. There’s currently no sanitization to strip commas before conversion, so any numeric field with a thousands separator will trigger this bug. Recent Dify updates have added some sanitization for complex default values in plugin parameters, but not specifically for numbers with commas. To avoid this error, make sure any numeric values in your model configuration are plain numbers (e.g., `131072` instead of `'131,072'`). If you control the schema or config, remove any formatting from numeric fields before submitting them to Dify. This issue should ideally be fixed in the Dify core by sanitizing numeric inputs before parsing. For now, manual cleanup of number formatting is the best workaround. Reference: - [Plugin code does not handle numeric parsing; issue is in Dify core](https://github.com/langgenius/dify-official-plugins/blob/3eae206018c83c8ace10123e3fda3ee4f5926e0e/extensions/openai_compatible/endpoints/openai_compatible.py#L7-L243) - [Recent PRs address schema validation but not comma sanitization](https://github.com/langgenius/dify/pull/27159) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/06a6c172-fbca-4772-b0d1-d4568f4d0701?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2043)
Author
Owner

@hjlarry commented on GitHub (Nov 11, 2025):

I can't reproduce this issue, which model did you add?

@hjlarry commented on GitHub (Nov 11, 2025): I can't reproduce this issue, which model did you add?
Author
Owner

@simpsonyang commented on GitHub (Nov 12, 2025):

Thanks for you reminder, I realized that the number "131,072" is the context length i copied. I stripped the comma and try again, but failed again, the log shows the same error. I even tried reinstall the plugin and modified the number to another value, but nothing changed. The weird thing is, no matter what i do, the log shows the same number.

@simpsonyang commented on GitHub (Nov 12, 2025): Thanks for you reminder, I realized that the number "131,072" is the context length i copied. I stripped the comma and try again, but failed again, the log shows the same error. I even tried reinstall the plugin and modified the number to another value, but nothing changed. The weird thing is, no matter what i do, the log shows the same number.
Author
Owner

@dosubot[bot] commented on GitHub (Nov 29, 2025):

Hi, @simpsonyang. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that in Dify v1.9.2 self-hosted via Docker, models added to the OpenAI-compatible plugin do not appear despite HTTP 200 responses.
  • The root cause was identified as Dify core failing to parse numeric strings with commas (e.g., "131,072") due to missing sanitization before integer conversion.
  • You tried removing commas manually and reinstalling the plugin, but the error persisted with logs still showing the same number, indicating a possible deeper issue or caching.
  • The maintainer requested details on the specific model added, but no further updates or resolution have been provided.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If no response is received within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 29, 2025): Hi, @simpsonyang. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Dify v1.9.2 self-hosted via Docker, models added to the OpenAI-compatible plugin do not appear despite HTTP 200 responses. - The root cause was identified as Dify core failing to parse numeric strings with commas (e.g., "131,072") due to missing sanitization before integer conversion. - You tried removing commas manually and reinstalling the plugin, but the error persisted with logs still showing the same number, indicating a possible deeper issue or caching. - The maintainer requested details on the specific model added, but no further updates or resolution have been provided. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If no response is received within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#797