Skip to main content
AIDevOps
  • Learn
  • Learning Paths
  • Practice
  • Open Source
  • Books
  • Engineering

    AI DevOpsThe full map of building and operating AI servicesLLMOpsLLM deployment · evaluation · observabilityHands-on ProjectsBuild AI Agent projects

    Knowledge

    DocsTechnical documentationBlogEngineering articlesPloggerDevelopment log feed

    Validate

    Certification3-level skills certification · coming soon
AI Models
LlamaTutorial|MistralTutorial|GemmaTutorial|DeepSeekTutorial|QwenTutorial
🧠 AI Core
AI Intro & RoadmapML FundamentalsLLM Fundamentals|Python AIC++|PyTorchTensorFlowJAX
🤖 AI Applied Development
Applied AI Intro & RoadmapHugging FaceLangChainLlamaIndexLLMOps|LangGraphMCPMulti-AgentAgent Evaluation
🧠 AI Agent Development
Finance AI AgentLLM API ServerStock Investing AgentAIOps AI AgentEducation AI AgentCoding AI Agent
🌱 Spring Cloud
Spring Intro & RoadmapSpring Cloud GatewaySpring BootJava|Spring AISpring SecuritySpring BatchSpring JPA
🐳 DevOps
DevOps Intro & RoadmapLinuxDockerCI/CD|Kubernetes BasicsK8s AdvancedPrometheusGrafana
🧱 Infrastructure
Infrastructure Intro & RoadmapNginxRedis
☁️ Cloud
Cloud Intro & RoadmapAWSGCPAzureNCPCloudflare
🎨 Frontend
Frontend Intro & RoadmapJavaScriptTypeScript|ReactNext.js|VueNuxt|Electron
📱 Mobile
Mobile Intro & RoadmapKotlinAndroidFlutter
⚙️ Backend
Backend Intro & RoadmapPython BasicsFastAPIDjangoFlask|CGoGinNode.js
💾 Database
DB Intro & RoadmapCore SQLOracleMySQLPostgreSQL|MongoDBVector DB
🧪 Testing
k6JMeternGrinder
AIDevOps

Engineering AI. From Code to Production.
An engineering learning platform for building and operating AI and AI Agents

Learn

  • All Guides
  • Learning Paths
  • AI Tutorial
  • Practice
  • Books

Resources

  • AI DevOps
  • LLMOps
  • Hands-on Projects
  • Docs
  • Blog
  • Plogger
  • Open Source
  • Certification (coming soon)

Start Here

  • AI Core Roadmap
  • AI Applied Development Roadmap
  • Spring Cloud Roadmap
  • DevOps Roadmap
  • Infrastructure Roadmap

 

  • Cloud Roadmap
  • Frontend Roadmap
  • Mobile Roadmap
  • Backend Roadmap
  • Database Roadmap
© 2026 AIDevOps. All rights reserved.
Terms of ServicePrivacy PolicySitemaptestforge.kr
Multilingual Open-Weight LLM Guide

🤖 Qwen Complete Guide

Visitors

Qwen is Alibaba’s family of open-weight models released under Apache 2.0, ranging from 0.8B to hundreds of billions of parameters and covering around 200 languages, which makes it popular for multilingual services. This guide goes from choosing among general, coding, vision and embedding models to running locally, thinking mode, multilingual embeddings and the API.

← Back to AIDevOps home
🤖

Qwen Practical Examples

Examples of running Qwen locally, tool calling, a coding agent and fine-tuning.

View practical examples →

Contents

0 / 11
  1. Qwen at a glance
  2. Model lineup & how to choose
  3. License
  4. Running locally with Ollama
  5. Thinking mode
  6. Image input
  7. Function calling
  8. Qwen3 Embedding
  9. Model Studio API
  10. Troubleshooting
  11. FAQ
Contents 11 sections
  1. Qwen at a glance
  2. Model lineup & how to choose
  3. License
  4. Running locally with Ollama
  5. Thinking mode
  6. Image input
  7. Function calling
  8. Qwen3 Embedding
  9. Model Studio API
  10. Troubleshooting
  11. FAQ

Qwen at a glance

Qwen (通义千问) is Alibaba’s LLM family. Alongside general models it releases coding (Coder), vision (VL) and embedding models in the same family, so you can build RAG, agents and coding tools entirely from one vendor’s models.

WhenKey modelsWhat changed
April 2025Qwen30.6B-32B dense + 30B-A3B and 235B-A22B MoE, 119 languages, thinking mode
2025Qwen3-Coder, Qwen3-VL, Qwen3 EmbeddingDedicated coding, vision and embedding models
February 2026Qwen3.5Gated DeltaNet + sparse MoE architecture, image input, 201 languages and dialects, 256K context
April 2026Qwen3.627B dense and 35B-A3B MoE
August 2026Qwen3.8Open-weight 27B (Apache 2.0) and the commercial top model Qwen3.8-Max, stronger at agent tasks
💡

To build a RAG system that searches company documents and answers with citations using Qwen3 Embedding and Qwen3.5, see the company-docs RAG tutorial with Qwen.

Model lineup & how to choose

ModelOllama tag (size)InputBest for
Qwen3.8 27Bqwen3.8:27b (about 18 GB)Text, image, videoLatest general and agent work, 24 GB GPU
Qwen3.6qwen3.6:27b, qwen3.6:35bText, imageThe generation before 3.8; a settled choice
Qwen3.5 smallqwen3.5:0.8b-qwen3.5:9b (1.0-6.6 GB)Text, imageLaptops and edge, classification and extraction, RAG answers
Qwen3.5 largeqwen3.5:27b (17 GB), 35b (24 GB, MoE), 122b (81 GB, MoE)Text, imageHigh-quality servers
Qwen3-Coderqwen3-coder:30b, 480bCodeCoding agents and code review
Qwen3-VLqwen3-vl:2b-235bText, imageVision work focused on documents and screens
Qwen3 Embeddingqwen3-embedding:0.6b, 4b, 8bTextMultilingual search and RAG embeddings

35B-A3B in a name means an MoE with 35B total and 3B active per token. Speed follows active parameters; the memory you need follows total parameters. On Apple Silicon, MLX tags such as qwen3.5:9b-mlx are faster.

License

ModelsLicenseWhat it means
Open-weight Qwen (3.8 27B, 3.6, 3.5, Coder, VL, Embedding)Apache 2.0Free commercial use, modification and redistribution; keep the license notice
Top models such as Qwen3.8-MaxCommercial (no public weights)Paid use through the Alibaba Cloud Model Studio API
ℹ️

Check the LICENSE file of each repository you download from Hugging Face or ModelScope. Even within one generation, availability can differ by size and purpose.

Running locally with Ollama

BASH
ollama pull qwen3.5:9b           # laptop default (about 6.6 GB)
ollama pull qwen3.8:27b          # 24 GB GPU (about 18 GB)
ollama pull qwen3-embedding:0.6b # embeddings
ollama pull qwen3-coder:30b      # coding

ollama run qwen3.5:9b "Compare Kubernetes HPA and VPA in a table"
ℹ️

Qwen3.5 and later support a 256K context, but Ollama runs with a default sized to your GPU memory (4K below 24 GiB). Raise num_ctx for long documents.

Thinking mode

Qwen3 and later can switch thinking mode on and off, and Qwen3.8 has it on by default. In Ollama, control it per request with think; the reasoning arrives separately in message.thinking.

qwen_thinking.pyPYTHON
from ollama import chat

question = "With 100 million rows in the orders table, what index strategy makes a last-30-days revenue query fast?"

fast = chat(model="qwen3.8:27b", messages=[{"role": "user", "content": question}], think=False)
print("[fast answer]", fast.message.content[:300])

deep = chat(model="qwen3.8:27b", messages=[{"role": "user", "content": question}], think=True)
print("[reasoning]", (deep.message.thinking or "")[:300], "...")
print("[deep answer]", deep.message.content[:300])

Image input

qwen_vision.pyPYTHON
from ollama import chat

resp = chat(
    model="qwen3.5:9b",
    messages=[{
        "role": "user",
        "content": "Which metrics and times in this dashboard screenshot look anomalous?",
        "images": ["./grafana.png"],
    }],
    think=False,
)
print(resp.message.content)

Function calling

qwen_tools.pyPYTHON
from ollama import chat

def get_exchange_rate(base: str, target: str) -> dict:
    """Get the current exchange rate between two currencies.

    Args:
      base: Base currency code (e.g. USD)
      target: Target currency code (e.g. EUR)
    """
    return {"base": base, "target": target, "rate": 0.92}

messages = [{"role": "user", "content": "How much is 1,200 dollars in euros?"}]
resp = chat(model="qwen3.5:9b", messages=messages, tools=[get_exchange_rate], think=False)
messages.append(resp.message)

for call in resp.message.tool_calls or []:
    result = get_exchange_rate(**call.function.arguments)
    messages.append({"role": "tool", "tool_name": call.function.name, "content": str(result)})

print(chat(model="qwen3.5:9b", messages=messages, think=False).message.content)

Qwen3 Embedding

Qwen3 Embedding is a retrieval embedding model supporting over 100 languages. The 0.6B model supports up to 1024 dimensions (choose 32-1024) and 32K-token inputs. The rule is add an instruction to search queries, not to documents.

qwen_embedding.pyPYTHON
import math
from ollama import embed

TASK = "Given a web search query, retrieve relevant passages that answer the query"

def query_text(q: str) -> str:
    return f"Instruct: {TASK}\nQuery:{q}"      # instruction on queries only

docs = ["Employees get 15 days of paid leave after one year.", "Return your laptop to IT when you leave.", "Request VPN access in the company portal."]
doc_vecs = embed(model="qwen3-embedding:0.6b", input=docs).embeddings          # documents as they are
q_vec = embed(model="qwen3-embedding:0.6b", input=[query_text("How many vacation days do I get?")]).embeddings[0]

def cosine(a, b):
    return sum(x * y for x, y in zip(a, b)) / (math.sqrt(sum(x * x for x in a)) * math.sqrt(sum(y * y for y in b)))

for doc, vec in sorted(zip(docs, doc_vecs), key=lambda p: -cosine(q_vec, p[1])):
    print(f"{cosine(q_vec, vec):.3f}  {doc}")

Model Studio API

Models without public weights, such as Qwen3.8-Max, are used through Alibaba Cloud Model Studio’s OpenAI-compatible API. The endpoint depends on region and workspace, so use the value shown in the console.

qwen_api.pyPYTHON
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    # e.g. the US (Virginia) region. Singapore, Tokyo and others use an address with your workspace ID
    base_url="https://dashscope-us.aliyuncs.com/compatible-mode/v1",
)
resp = client.chat.completions.create(
    model="qwen3.8-max",
    messages=[{"role": "user", "content": "Make a checklist for adopting a service mesh"}],
)
print(resp.choices[0].message.content)
ℹ️

How thinking mode is controlled and how API models are priced differ by model, so check the Model Studio documentation for the model you use.

Troubleshooting

SymptomCauseFix
Long reasoning before every answerThinking is on by default in Qwen3.8think=False
Irrelevant search resultsNo instruction on queries, or an instruction added to documents tooApply Instruct: ...\nQuery: to queries only
Forgets the start of long documentsOllama’s default context (4K, etc.)Raise num_ctx or OLLAMA_CONTEXT_LENGTH
Answers drift into another languageSmall model, no language set in the system promptState the answer language explicitly; use 9B or larger
Model Studio 401 / 404Region endpoint does not match the key or workspaceMatch base_url to the console’s region

Frequently asked questions

Can I use Qwen commercially for free?

Open-weight models such as Qwen3.8 27B, Qwen3.6, Qwen3.5, Qwen3-Coder and Qwen3 Embedding are Apache 2.0, so commercial use, modification and redistribution are free. Top models such as Qwen3.8-Max are commercial with no public weights and are only available through the Alibaba Cloud Model Studio API.

How good is Qwen in languages other than English?

Qwen3.5 and later were trained on about 200 languages and dialects, and quality in major languages is solid for production use. Quality varies a lot with model size, so if non-English answer quality matters, start at 9B or larger and evaluate with real questions from your users.

Qwen3.8 produces very long reasoning.

Thinking mode is on by default in Qwen3.8. In Ollama, pass think=False to chat to turn it off per request. For simple Q&A or classification that needs no deep reasoning, turning it off makes responses faster.

Should queries and documents be treated differently with Qwen3 Embedding?

Yes. Prefix search queries with an instruction in the form "Instruct: task description\nQuery:question", and leave documents without one. Embedding queries without the instruction still works, but retrieval accuracy can drop.

Which is faster, Qwen3.5 35B or 27B?

35B is an MoE model (35B-A3B) that computes only about 3B parameters per token, so it responds much faster than the 27B dense model. Memory still follows total parameters: about 24 GB for 35B and 17 GB for 27B in Ollama. Quality depends on the task, so evaluate both.