From aa22b622d013a73f355754a1184d980179f8ec91 Mon Sep 17 00:00:00 2001 From: Miroslav Pokrovskii <7105861+mirpo@users.noreply.github.com> Date: Wed, 14 May 2025 19:52:13 +0300 Subject: [PATCH] feat: add qwen3 support (#6528) ## Why are these changes needed? Add ollama qwen 3 support --- .../src/autogen_ext/models/ollama/_model_info.py | 16 ++++++++++++++++ .../models/test_ollama_chat_completion_client.py | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/python/packages/autogen-ext/src/autogen_ext/models/ollama/_model_info.py b/python/packages/autogen-ext/src/autogen_ext/models/ollama/_model_info.py index 158a0008f..6ab239c95 100644 --- a/python/packages/autogen-ext/src/autogen_ext/models/ollama/_model_info.py +++ b/python/packages/autogen-ext/src/autogen_ext/models/ollama/_model_info.py @@ -258,6 +258,13 @@ _MODEL_INFO: Dict[str, ModelInfo] = { "family": ModelFamily.UNKNOWN, "structured_output": True, }, + "qwen3": { + "vision": False, + "function_calling": True, + "json_output": True, + "family": ModelFamily.UNKNOWN, + "structured_output": True, + }, "snowflake-arctic-embed": { "vision": False, "function_calling": False, @@ -351,6 +358,15 @@ _MODEL_TOKEN_LIMITS: Dict[str, int] = { "qwen2.5-coder:0.5b": 32768, "qwen2.5-coder:1.5b": 32768, "qwen2.5-coder:3b": 32768, + "qwen3": 40960, + "qwen3:0.6b": 40960, + "qwen3:1.7b": 40960, + "qwen3:4b": 40960, + "qwen3:8b": 40960, + "qwen3:14b": 40960, + "qwen3:30b": 40960, + "qwen3:32b": 40960, + "qwen3:235b": 40960, "snowflake-arctic-embed": 512, "starcoder2": 16384, "tinyllama": 2048, diff --git a/python/packages/autogen-ext/tests/models/test_ollama_chat_completion_client.py b/python/packages/autogen-ext/tests/models/test_ollama_chat_completion_client.py index c020c6f93..de2db33dd 100644 --- a/python/packages/autogen-ext/tests/models/test_ollama_chat_completion_client.py +++ b/python/packages/autogen-ext/tests/models/test_ollama_chat_completion_client.py @@ -570,7 +570,7 @@ async def test_ollama_create_structured_output(model: str, ollama_client: Ollama @pytest.mark.asyncio -@pytest.mark.parametrize("model", ["qwen2.5:0.5b", "llama3.2:1b"]) +@pytest.mark.parametrize("model", ["qwen2.5:0.5b", "llama3.2:1b", "qwen3:0.6b"]) async def test_ollama_create_tools(model: str, ollama_client: OllamaChatCompletionClient) -> None: def add(x: int, y: int) -> str: return str(x + y) @@ -653,7 +653,7 @@ async def test_ollama_create_structured_output_with_tools( @pytest.mark.asyncio -@pytest.mark.parametrize("model", ["qwen2.5:0.5b", "llama3.2:1b"]) +@pytest.mark.parametrize("model", ["qwen2.5:0.5b", "llama3.2:1b", "qwen3:0.6b"]) async def test_ollama_create_stream_tools(model: str, ollama_client: OllamaChatCompletionClient) -> None: def add(x: int, y: int) -> str: return str(x + y)