Skip to content

Add ModelScope API-Inference provider support to Copilot#11

Draft
HeDaas-Code with Copilot wants to merge 5 commits into
mainfrom
copilot/add-api-inference-service
Draft

Add ModelScope API-Inference provider support to Copilot#11
HeDaas-Code with Copilot wants to merge 5 commits into
mainfrom
copilot/add-api-inference-service

Conversation

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Adds ModelScope API-Inference as a second LLM provider for Copilot, allowing users to choose between SiliconFlow and ModelScope based on availability and preference.

Implementation

  • New client: modelscope_client.py implementing chat completion, streaming, embeddings, and connection testing against https://api-inference.modelscope.cn/v1

  • Provider abstraction: Added PROVIDER_SILICONFLOW and PROVIDER_MODELSCOPE constants to eliminate hardcoded strings. CopilotManager now initializes appropriate client based on configured provider.

  • UI enhancement: Settings dialog includes provider dropdown with dynamic model lists. Provider-to-display-name mapping prevents brittle string comparisons.

  • Configuration: Provider persisted as copilot.provider setting. Backward compatible—defaults to SiliconFlow if unset.

Usage

# In copilot_manager.py
from .copilot_manager import PROVIDER_MODELSCOPE

manager.set_api_key(api_key, model, provider=PROVIDER_MODELSCOPE)
manager.set_provider(PROVIDER_MODELSCOPE)

Settings UI allows runtime switching between providers without code changes.

Model Naming

ModelScope uses lowercase namespaces (qwen/Qwen2.5-7B-Instruct) vs SiliconFlow's uppercase (Qwen/Qwen2.5-7B-Instruct). Model lists update dynamically based on selected provider.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.modelscope.cn
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>为copilot服务添加API-Inference大模型服务提供</issue_title>
<issue_description>为copilot服务添加API-Inference大模型服务提供
https://www.modelscope.cn/docs/model-service/API-Inference/intro</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 7, 2026 07:15
Co-authored-by: HeDaas-Code <208586641+HeDaas-Code@users.noreply.github.com>
Co-authored-by: HeDaas-Code <208586641+HeDaas-Code@users.noreply.github.com>
Co-authored-by: HeDaas-Code <208586641+HeDaas-Code@users.noreply.github.com>
Co-authored-by: HeDaas-Code <208586641+HeDaas-Code@users.noreply.github.com>
Copilot AI changed the title [WIP] Add API-Inference large model service for copilot Add ModelScope API-Inference provider support to Copilot Jan 7, 2026
Copilot AI requested a review from HeDaas-Code January 7, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

为copilot服务添加API-Inference大模型服务提供

2 participants