Qwenlab AI
PRIVATE GPU / OPENAI COMPATIBLE

Your Qwen.
One API.

Private 27B GPU inference behind a clean OpenAI-compatible HTTPS API — tuned for Kilo Code, Cline, tool calling, and streaming.

Checking gateway…

POST /v1/chat/completionsRESPONSE / ILLUSTRATION
{
  "model": "qwen3.8-27B-14GB-IQ4:latest",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Ready when you are."
    }
  }]
}
api.qwenlab.ir/v1 · OpenAI Compatible · Tools & Streaming
27BQwen3.8 IQ4 model
24kDefault context window
SSEStreamed chat & usage
FA / ENBilingual documentation
01 / CAPABILITIES

Capabilities

This deployment serves qwen3.8-27B-14GB-IQ4:latest (Qwen3.5 architecture, ~27B, IQ4_XS) on a private GPU. Ollama reports native support for completion, thinking, and tools.

Available

AI Coding Agents

Full OpenAI compatibility for Kilo Code, Cline, Cursor, and custom agents: content-part arrays, tool history, and streaming usage.

Available

Text generation

Multi-turn chat, coding, Persian & English, system prompts, structured JSON output, and long-form answers.

Available

Streaming (SSE)

Low-latency token streaming via stream: true and stream_options.include_usage.

Available

Thinking / reasoning

Per-request reasoning mode returning reasoning_content and reasoning alongside final content.

Available

Tool / function calling

OpenAI-style tools, tool_choice, and multi-turn tool_call_id state mapping.

Not on this build

Image input (vision)

No vision weights. Do not send image URLs or base64 image parts — requests with images return 400.

Not public

Live web browsing

Public chat-completions has no server-side search tools. Agents supply their own client-side tools.

Not public

Embeddings API

/v1/embeddings is not proxied on this endpoint. Use chat completions only.

02 / QUICKSTART

Quickstart

  1. Set the base URL

    Use https://api.qwenlab.ir/v1 (include /v1).

  2. Authenticate

    Header Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY. Never publish real keys.

  3. Pick the model

    qwen3.8-27B-14GB-IQ4:latest

  4. Connect your AI coding agent

    Select OpenAI Compatible in Kilo Code, Cline, or your SDK and point it to /v1.

config
BASE_URL=https://api.qwenlab.ir/v1
API_KEY=YOUR_API_KEY
MODEL=qwen3.8-27B-14GB-IQ4:latest
03 / REFERENCE

Public endpoints

Only these paths are reverse-proxied to the inference gateway. All other paths serve static docs or return 404.

MethodPathAuthDescription
GET /health No Gateway liveness & capabilities
GET /v1/models Yes List available models
POST /v1/chat/completions Yes Chat / code / tools (stream & non-stream)
04 / TEXT CHAT

Text chat

Standard OpenAI chat format: an array of messages with roles system, developer, user, assistant, and tool. Both string and array content parts are supported.

POST /v1/chat/completions
{
  "model": "qwen3.8-27B-14GB-IQ4:latest",
  "messages": [
    { "role": "system", "content": "You are a precise coding assistant." },
    { "role": "user", "content": "Write a typed Python palindrome helper." }
  ],
  "temperature": 0.2,
  "max_tokens": 400,
  "stream": false
}
Multi-turn: append prior assistant replies and tool responses to messages to keep conversation state on the client. The API is stateless.
05 / STREAMING

Streaming

Set "stream": true. The response is text/event-stream with OpenAI-style data: chunks, optional final usage, and [DONE].

curl · stream
curl -N https://api.qwenlab.ir/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27B-14GB-IQ4:latest",
    "messages": [{"role":"user","content":"Outline a REST error taxonomy."}],
    "stream": true,
    "stream_options": {"include_usage": true},
    "max_tokens": 250
  }'
06 / THINKING

Thinking / reasoning

This model supports a thinking mode. Turn it on or off per request with OpenAI-compatible fields. Server default is off (OPENAI_THINK=false) for fast coding turns.

  • think

    true / false — direct switch (recommended).

  • enable_thinking

    Alias of think.

  • reasoning_effort

    none → off. minimal | low | medium | high | xhigh → on.

  • chat_template_kwargs.enable_thinking

    Nested bool sent by some Qwen clients.

When thinking is on, responses and stream deltas include reasoning_content and reasoning alongside content.

thinking off (fast)
{
  "model": "qwen3.8-27B-14GB-IQ4:latest",
  "messages": [{ "role": "user", "content": "Say OK" }],
  "think": false,
  "max_tokens": 256
}
reasoning_effort style
{
  "model": "qwen3.8-27B-14GB-IQ4:latest",
  "messages": [{ "role": "user", "content": "Plan a safe DB migration." }],
  "reasoning_effort": "high",
  "max_tokens": 2048
}
07 / TOOL CALLING

Tool calling

Pass OpenAI-compatible tools and tool_choice. When the model returns tool_calls, execute them in your agent and reply with a tool role message matching tool_call_id.

tools sketch
{
  "model": "qwen3.8-27B-14GB-IQ4:latest",
  "messages": [
    { "role": "user", "content": "Convert 72 F to Celsius using the tool." }
  ],
  "tools": [{
    "type": "function",
    "function": {
      "name": "fahrenheit_to_celsius",
      "description": "Convert °F to °C",
      "parameters": {
        "type": "object",
        "properties": {
          "f": { "type": "number" }
        },
        "required": ["f"]
      }
    }
  }]
}
08 / PARAMETERS

Useful parameters

  • model

    Model ID: qwen3.8-27B-14GB-IQ4:latest.

  • messages

    Conversation turns. Supports string or OpenAI content-part arrays.

  • stream

    true for SSE; false for a single JSON object.

  • stream_options

    Pass {"include_usage": true} to receive token counts in SSE.

  • think / reasoning_effort

    false / none by default; enable per request for deep reasoning.

  • temperature

    Lower (0–0.3) for coding & tool use; higher for creative drafting.

  • max_tokens

    Cap on generated tokens. Defaults to 8192 when omitted.

  • response_format

    Supports json_object and json_schema.

  • tools & tool_choice

    Function schemas and choice control (auto, none, or specific function).

Context: default num_ctx is tuned for the 16 GB GPU (24576 tokens by default). Clients may override via options.num_ctx.
09 / EXAMPLES

Examples

Health check

bash
curl -sS https://api.qwenlab.ir/health

List models

bash
curl -sS https://api.qwenlab.ir/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Persian text

bash
curl -sS https://api.qwenlab.ir/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27B-14GB-IQ4:latest",
    "messages": [{"role":"user","content":"SSD را در سه جمله توضیح بده."}],
    "stream": false,
    "max_tokens": 300
  }'

Python (OpenAI SDK)

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.qwenlab.ir/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="qwen3.8-27B-14GB-IQ4:latest",
    messages=[{"role": "user", "content": "Summarize TCP handshake."}],
    stream=False,
    extra_body={"think": False},
)
print(resp.choices[0].message.content)
10 / CLIENTS

Clients

Kilo Code / Cline

Choose the OpenAI Compatible provider in extension settings. Supports streaming, tool calling, and token usage tracking.

Provider
OpenAI Compatible
Base URL
https://api.qwenlab.ir/v1
API key
YOUR_API_KEY
Model ID
qwen3.8-27B-14GB-IQ4:latest

Hermes / OpenClaw

OpenAI-compatible connector. Pass thinking flags per request if deep reasoning is needed.

Base URL
https://api.qwenlab.ir/v1
Endpoint
/v1/chat/completions
Thinking
think / reasoning_effort in body
Timeout
allow long runs (~600s)

OpenAI SDK / cURL

Point any standard OpenAI SDK client at this HTTPS base URL with Bearer or X-API-Key auth.

Auth
Authorization: Bearer …
Alt
X-API-Key: …
Scope
inference only
11 / LIMITS

Limits & operations

This is a personal GPU relay hosted through an encrypted reverse tunnel to Iran edge infrastructure. The origin PC must be online with the gateway and tunnel healthy. Invalid keys return 401.

If the local GPU is momentarily busy with a background job, chat requests wait up to 30 seconds in queue and return 429 with Retry-After if still occupied.

Security: never paste real API keys into public repositories, screenshots, or client logs. This page only documents placeholders (YOUR_API_KEY).
12 / CONTACT

Contact & API access

Need an API key or integration help for Kilo Code, Cline, or your own client? Reach out with your project details and expected usage.

Request a key

Personal contact for Qwenlab AI API access and integration support.

software.eng.maleki@gmail.com

What to include

  1. Your name / project
  2. Intended client (Kilo Code, Cline, SDK, …)
  3. Expected usage (light / heavy)