Skip to content

Add DashScopeProvider #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The providers are imported from [providers.py](/os_computer_use/providers.py) an
- OS-Atlas (grounding)
- ShowUI (grounding)
- Moonshot
- DashScope
- Mistral AI (Pixtral for vision, Mistral Large for actions)

If you add a new model or provider, please [make a PR](../../pulls) to this repository with the updated providers.py!
Expand Down Expand Up @@ -104,6 +105,7 @@ GEMINI_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
MOONSHOT_API_KEY=...
DASHSCOPE_API_KEY=...
# Required: Provide your Hugging Face token to bypass Gradio rate limits.
HF_TOKEN=...
```
Expand Down
2 changes: 2 additions & 0 deletions os_computer_use/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
# vision_model = providers.MoonshotProvider("moonshot-v1-vision")
# vision_model = providers.MistralProvider("pixtral")
#vision_model = providers.GroqProvider("llama-3.2")
# vision_model = providers.DashScopeProvider("qwen-vl-max")
vision_model = providers.OpenRouterProvider("qwen-2.5-vl")

# action_model = providers.FireworksProvider("llama-3.3")
# action_model = providers.OpenAIProvider("gpt-4o")
# action_model = providers.AnthropicProvider("claude-3.5-sonnet")
# vision_model = providers.MoonshotProvider("moonshot-v1-vision")
# action_model = providers.MistralProvider("mistral")
# action_model = providers.DashScopeProvider("qwen-max")
action_model = providers.GroqProvider("llama-3.3")
8 changes: 8 additions & 0 deletions os_computer_use/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ class OpenRouterProvider(OpenAIBaseProvider):
"qwen-2.5-vl":"qwen/qwen2.5-vl-72b-instruct:free"
}

class DashScopeProvider(OpenAIBaseProvider):
base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1"
api_key = os.getenv("DASHSCOPE_API_KEY")
aliases = {
"qwen-max": "qwen-max",
"qwen-vl-max":"qwen-vl-max"
}


class FireworksProvider(OpenAIBaseProvider):
base_url = "https://api.fireworks.ai/inference/v1"
Expand Down