Siliconflow Model Provider: TypeError - Missing 'self' argument in validate_credentials() during credential submission #717

Closed
opened 2026-02-16 10:20:17 -05:00 by yindo · 1 comment
Owner

Originally created by @guorenn on GitHub (Oct 14, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

v1.91

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Deploy Dify using Docker Compose following the official documentation.
  2. Access the Dify Console, navigate to "Workspace Settings" -> "Model Providers".
  3. Locate "Siliconflow" in the list of model providers, click "Add Credential".
  4. Fill in the required Siliconflow credentials (e.g., API Key) and click "Submit" to save.
  5. Observe the error in the browser (credential submission fails) and check the Docker container logs for details.

✔️ Expected Behavior

After entering valid Siliconflow credentials and clicking "Submit", the credentials should be validated successfully, and the Siliconflow model provider should be added to the workspace without errors.

Actual Behavior

When submitting Siliconflow credentials, the submission fails immediately. The browser shows a generic "Error" message("Internal Server Error"), and Docker container logs reveal a TypeError: SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'. This indicates the validate_credentials() method of the SiliconflowLargeLanguageModel class is being called directly via the class name (instead of an instance), causing Python to fail to inject the self parameter automatically. The Siliconflow model provider cannot be added as a result.

Bug Report Log
2025-10-15 01:37:50.696 ERROR [Dummy-7] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"TypeError\\",\\"message\\":\\"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: \'self\'\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} 2025-10-15 01:37:50.697 ERROR [Dummy-7] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow/credentials [POST] Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/api.py", line 402, in wrapper resp = resource(*args, **kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/resource.py", line 41, in dispatch_request resp = meth(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 215, in decorated return view(*args, **kwargs) File "/app/api/libs/login.py", line 62, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 37, in decorated return view(*args, **kwargs) File "/app/api/controllers/console/workspace/model_providers.py", line 89, in post model_provider_service.create_provider_credential( File "/app/api/services/model_provider_service.py", line 166, in create_provider_credential provider_configuration.create_provider_credential(credentials, credential_name) File "/app/api/core/entities/provider_configuration.py", line 444, in create_provider_credential credentials = self.validate_provider_credentials(credentials=credentials, session=session) File "/app/api/core/entities/provider_configuration.py", line 357, in validate_provider_credentials return _validate(session) File "/app/api/core/entities/provider_configuration.py", line 346, in _validate validated_credentials = model_provider_factory.provider_credentials_validate( File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 123, in provider_credentials_validate self.plugin_model_manager.validate_provider_credentials( File "/app/api/core/plugin/impl/model.py", line 97, in validate_provider_credentials for resp in response: File "/app/api/core/plugin/impl/base.py", line 212, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/impl/base.py", line 246, in _handle_plugin_daemon_error raise PluginInvokeError(description=message) core.plugin.impl.exc.PluginInvokeError: req_id: 8e3d597e64 PluginInvokeError: {"args":{},"error_type":"TypeError","message":"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'"}

Originally created by @guorenn on GitHub (Oct 14, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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 [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version v1.91 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Deploy Dify using Docker Compose following the official documentation. 2. Access the Dify Console, navigate to "Workspace Settings" -> "Model Providers". 3. Locate "Siliconflow" in the list of model providers, click "Add Credential". 4. Fill in the required Siliconflow credentials (e.g., API Key) and click "Submit" to save. 5. Observe the error in the browser (credential submission fails) and check the Docker container logs for details. ### ✔️ Expected Behavior After entering valid Siliconflow credentials and clicking "Submit", the credentials should be validated successfully, and the Siliconflow model provider should be added to the workspace without errors. ### ❌ Actual Behavior When submitting Siliconflow credentials, the submission fails immediately. The browser shows a generic "Error" message("Internal Server Error"), and Docker container logs reveal a TypeError: SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'. This indicates the validate_credentials() method of the SiliconflowLargeLanguageModel class is being called directly via the class name (instead of an instance), causing Python to fail to inject the self parameter automatically. The Siliconflow model provider cannot be added as a result. Bug Report Log `2025-10-15 01:37:50.696 ERROR [Dummy-7] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"TypeError\\",\\"message\\":\\"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: \'self\'\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} 2025-10-15 01:37:50.697 ERROR [Dummy-7] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow/credentials [POST] Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/api.py", line 402, in wrapper resp = resource(*args, **kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/resource.py", line 41, in dispatch_request resp = meth(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 215, in decorated return view(*args, **kwargs) File "/app/api/libs/login.py", line 62, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 37, in decorated return view(*args, **kwargs) File "/app/api/controllers/console/workspace/model_providers.py", line 89, in post model_provider_service.create_provider_credential( File "/app/api/services/model_provider_service.py", line 166, in create_provider_credential provider_configuration.create_provider_credential(credentials, credential_name) File "/app/api/core/entities/provider_configuration.py", line 444, in create_provider_credential credentials = self.validate_provider_credentials(credentials=credentials, session=session) File "/app/api/core/entities/provider_configuration.py", line 357, in validate_provider_credentials return _validate(session) File "/app/api/core/entities/provider_configuration.py", line 346, in _validate validated_credentials = model_provider_factory.provider_credentials_validate( File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 123, in provider_credentials_validate self.plugin_model_manager.validate_provider_credentials( File "/app/api/core/plugin/impl/model.py", line 97, in validate_provider_credentials for resp in response: File "/app/api/core/plugin/impl/base.py", line 212, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/impl/base.py", line 246, in _handle_plugin_daemon_error raise PluginInvokeError(description=message) core.plugin.impl.exc.PluginInvokeError: req_id: 8e3d597e64 PluginInvokeError: {"args":{},"error_type":"TypeError","message":"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'"} `
yindo added the bug label 2026-02-16 10:20:17 -05:00
yindo closed this issue 2026-02-16 10:20:17 -05:00
Author
Owner

@susan-0729 commented on GitHub (Oct 19, 2025):

I also encountered this issue.
I modified the validate_credentials function definition in dify_plugin/interfaces/model/openai_compatible/llm.py to:

@classmethod
def validate_credentials(cls, model: str, credentials: dict) -> None:

Then, in models/llm.py, I changed the validate_credentials function definition to:

@classmethod
def validate_credentials(cls, model: str, credentials: dict) -> None:
    cls._add_custom_parameters(credentials)
    super(SiliconflowLargeLanguageModel, cls).validate_credentials(model, credentials)

After making these changes, I was able to solve the problem, and the SiliconFlow API now works properly.

@susan-0729 commented on GitHub (Oct 19, 2025): I also encountered this issue. I modified the `validate_credentials` function definition in `dify_plugin/interfaces/model/openai_compatible/llm.py` to: ```python @classmethod def validate_credentials(cls, model: str, credentials: dict) -> None: ``` Then, in `models/llm.py`, I changed the `validate_credentials` function definition to: ```python @classmethod def validate_credentials(cls, model: str, credentials: dict) -> None: cls._add_custom_parameters(credentials) super(SiliconflowLargeLanguageModel, cls).validate_credentials(model, credentials) ``` After making these changes, I was able to solve the problem, and the SiliconFlow API now works properly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#717