Skip to content
Regolo Logo

Qwen3.6-27B

Qwen3.6‑27B is a 27B‑parameter dense multimodal model from Alibaba with 262k+ context, unified text–vision thinking mode, and state‑of‑the‑art coding scores that rival or beat much larger MoE models under an Apache‑2.0 license.
Core Model
Chat

Getting Started

pip install requestsCode language: Bash (bash)
import requests


import requests


api_url = "https://api.regolo.ai/v1/chat/completions"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_REGOLO_KEY"
}
data = {
  "model": "qwen3.6-27b",
  "messages": [
    {
      "role": "user",
      "content": "Write a Python function to calculate the factorial of a number using recursion."
    }
  ],
  "reasoning_effort": "low"
}

response = requests.post(api_url, headers=headers, json=data)
print(response.json())Code language: Python (python)

Output

{
  "id": "chatcmpl-b71b2d37dd1cd9fc",
  "created": 1776889813,
  "model": "qwen3.6-27b",
  "object": "chat.completion",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHere's a clean, well-documented Python function that calculates the factorial of a number using recursion:\n\n```python\ndef factorial(n: int) -> int:\n    \"\"\"\n    Calculate the factorial of a non-negative integer using recursion.\n    \n    Args:\n        n (int): A non-negative integer.\n        \n    Returns:\n        int: The factorial of n.\n        \n    Raises:\n        ValueError: If n is negative.\n    \"\"\"\n    if n < 0:\n        raise ValueError(\"Factorial is not defined for negative numbers.\")\n    if n == 0:\n        return 1\n    return n * factorial(n - 1)\n```\n\n### Example Usage:\n```python\nprint(factorial(5))  # Output: 120\nprint(factorial(0))  # Output: 1\nprint(factorial(1))  # Output: 1\n```\n\n### How It Works:\n1. **Base Case**: If `n == 0`, the function returns `1` (since `0! = 1`).\n2. **Recursive Step**: For `n > 0`, it returns `n * factorial(n - 1)`, breaking the problem into smaller subproblems until it hits the base case.\n3. **Error Handling**: Raises a `ValueError` for negative inputs since factorials are undefined for negative integers.\n\n### ⚠️ Important Note:\nPython has a default recursion depth limit (usually ~1000). For large values of `n`, this function will raise a `RecursionError`. For production code or large numbers, consider using an iterative approach or Python's built-in `math.factorial()`.",
        "role": "assistant",
        "reasoning_content": "Here's a thinking process:\n\n1.  **Understand User Request:**\n   - **Task:** Write a Python function to calculate the factorial of a number.\n   - **Method:** Use recursion.\n   - **Language:** Python.\n\n2.  **Define Factorial:**\n   - The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n.\n   - Base cases: 0! = 1, 1! = 1\n   - Recursive relation: n! = n * (n-1)! for n > 1\n   - Negative numbers: Factorial is undefined for negative numbers. Should handle this appropriately (raise an error or return a message).\n\n3.  **Design Recursive Function:**\n   - Function name: `factorial`\n   - Parameter: `n` (integer)\n   - Base case: if n == 0 or n == 1, return 1\n   - Recursive step: return n * factorial(n - 1)\n   - Error handling: Check if n is negative or not an integer.\n\n4.  **Draft Code (Mental):**\n   ```python\n   def factorial(n):\n       if n < 0:\n           raise ValueError(\"Factorial is not defined for negative numbers.\")\n       if n == 0 or n == 1:\n           return 1\n       return n * factorial(n - 1)\n   ```\n\n5.  **Refine & Consider Edge Cases:**\n   - What about non-integer inputs? Could add type checking, but usually Python functions assume correct types unless specified. I'll add a simple type check or just document it. For simplicity, I'll stick to standard recursive implementation with a ValueError for negatives.\n   - Recursion depth limit: Python has a default recursion limit (~1000). For large n, this will fail. I should mention this limitation in comments/docstring.\n   - The base case `n == 0 or n == 1` can be simplified to `if n == 0: return 1` since 1! = 1 * 0! = 1 * 1 = 1. But keeping both is fine for clarity.\n\n   Let's write it cleanly:\n   ```python\n   def factorial(n: int) -> int:\n       if n < 0:\n           raise ValueError(\"Factorial is not defined for negative numbers.\")\n       if n == 0:\n           return 1\n       return n * factorial(n - 1)\n   ```\n\n6.  **Add Documentation & Example Usage:**\n   - Include docstring explaining purpose, parameters, return value, and notes on recursion limit.\n   - Provide example calls to demonstrate.\n\n   ```python\n   def factorial(n: int) -> int:\n       \"\"\"\n       Calculate the factorial of a non-negative integer using recursion.\n\n       Args:\n           n (int): A non-negative integer.\n\n       Returns:\n           int: The factorial of n.\n\n       Raises:\n           ValueError: If n is negative.\n       \"\"\"\n       if n < 0:\n           raise ValueError(\"Factorial is not defined for negative numbers.\")\n       if n == 0:\n           return 1\n       return n * factorial(n - 1)\n   ```\n\n7.  **Self-Correction/Verification:**\n   - Does it work for 0? Yes, returns 1.\n   - Does it work for 1? Yes, 1 * factorial(0) = 1 * 1 = 1.\n   - Does it work for 5? 5 * 4 * 3 * 2 * 1 * 1 = 120. Correct.\n   - Negative input? Raises ValueError. Good.\n   - Recursion limit? Mention it in comments/docstring. Good practice.\n   - Type hints? Added. Good.\n   - Is it strictly recursive? Yes.\n\n   Everything looks solid. I'll present the code clearly with explanations and usage examples. I'll also mention the recursion limit caveat as it's important for Python recursion.\n\n8.  **Final Output Generation:** (Structure the response)\n   - Provide the function code.\n   - Add docstring/comments.\n   - Show example usage.\n   - Briefly explain how it works.\n   - Mention limitations (recursion depth).\n   - Keep it concise.✅\n   Ready.✅\n   Output matches the refined version.✅\n   Proceed. \n   [Output Generation] -> *See response.* \n   Self-Correction/Note during thought: \n   Should I handle non-integer inputs? The prompt doesn't specify, but adding a quick type check or just noting it in the docstring is fine. I'll stick to type hints and assume valid input per standard practice, but mention it if needed. The current version is standard and clean.\n   All good.✅\n   Output matches the final refined code. \n   Proceeds. \n   [Done.] \n   *Self-Correction/Verification during generation prep:* \n   Actually, `if n == 0 or n == 1: return 1` is slightly more robust for some recursive paths, but `if n == 0: return 1` works perfectly because `factorial(1)` calls `factorial(0)` which returns 1. Both are fine. I'll keep `if n == 0: return 1` for simplicity.\n   I'll add a note about `sys.setrecursionlimit` for large numbers, but emphasize that iterative or `math.factorial` is better for production.\n   Final code structure:\n   ```python\n   def factorial(n: int) -> int:\n       if n < 0:\n           raise ValueError(\"Factorial is not defined for negative numbers.\")\n       if n == 0:\n           return 1\n       return n * factorial(n - 1)\n   ```\n   Looks perfect. Output matches response.✅\n   [Done.] \n   *Output Generation* (matches the final response)\n   \"Here’s a clean, well-documented Python function...\" etc.✅\n   All steps verified.✅\n   Proceeds. \n   [Final Check of the Prompt]: \"Write a Python function to calculate the factorial of a number using recursion.\" -> Matches exactly.✅\n   Ready. \n   [Output Generation] -> *Proceeds.*\n"
      }
    }
  ],
  "usage": {
    "completion_tokens": 1743,
    "prompt_tokens": 24,
    "total_tokens": 1767
  }
}Code language: JSON / JSON with Comments (json)

Additional Info

Benchmark Results

Applications & Use Cases

  • Coding assistants and DevOps copilots that solve complex SWE‑bench and Terminal‑Bench tasks, refactor multi‑file projects, and reason through CI/CD logs.
  • Long‑context RAG over codebases, system runbooks, and mixed text‑image documentation using the 262k context window for cross‑file and cross‑document reasoning.
  • Multimodal chat and analysis that combine text with screenshots, diagrams, or UI captures for debugging, support, and internal tooling.
  • Agentic workflows where thinking mode generates explicit reasoning traces before actions, improving reliability for tools such as shells, databases, and ticketing systems.
  • Teacher models for distillation or fine‑tuning of smaller coding‑focused LLMs, using Qwen3.6‑27B’s open weights and strong benchmark performance as a reference.