Open LLMs/unsloth

Open-Weight LLM · Private & Custom AI

Qwen3-4B-unsloth-bnb-4bit

4B reasoning model for private ops automation: thinking + non-thinking modes in a single deployable engine.

Qwen3-4B is a 4-billion-parameter dense LLM with switchable reasoning (thinking) and fast-inference (non-thinking) modes, built on Apache 2.0. It handles complex reasoning, multilingual tasks, and agent workflows while fitting on modest hardware. For ops teams, it's a self-hosted alternative to API-dependent reasoning models.

Unknown
Parameters
apache-2.0
License (OSI/permissive)
Unknown
Context
80.5k
Downloads

Model facts

Developerunsloth
ParametersUnknown
Context windowUnknown
Licenseapache-2.0 — OSI/permissive
Tasktext-generation
GatedNo
Downloads80.5k
Likes19
Updated2025-05-13
Sourceunsloth/Qwen3-4B-unsloth-bnb-4bit

Private deployment

Run Qwen3-4B-unsloth-bnb-4bit in your own environment

Self-host via vLLM (≥0.8.5), SGLang (≥0.4.5), or HuggingFace transformers on NVIDIA/consumer GPUs (see hardware section). Data stays in your environment; no third-party inference calls. Quantized 4-bit variant reduces VRAM ~50%. Requires transformers ≥4.51.0 for Qwen3 support.

Operational AI use cases

01

Internal support ticket routing & reasoning

Route inbound support tickets by reasoning through issue description and company knowledge base. Thinking mode analyzes problem context; non-thinking mode provides fast templated responses. Runs fully private; no customer data leaves infrastructure.

02

Finance & procurement document analysis

Extract invoice data, validate PO logic, flag policy violations. Thinking mode for edge-case rule interpretation; non-thinking for bulk extraction. Multilingual support handles international vendor docs.

03

Operations workflow agent

Build an agent that reasons about task dependencies (thinking), then calls internal APIs (non-thinking output). Example: approve expense reports by cross-checking budget rules, employee permissions, and prior spend—all in-house.

Custom AI

As a base for custom AI

Strong base for domain-specific reasoning products. Fine-tune on internal workflows, compliance rules, or domain-specific agent behaviors using Unsloth's optimized training (claimed 3x faster, 70% less memory). Export to Ollama or llama.cpp for production. Apache 2.0 allows commercial derivatives.

In the operating system

Where it fits

Reasoning & agent backbone in a private AI OS. Sits at the intersection of knowledge retrieval (reason over docs) and workflow automation (agents with tool calls). Thinking mode handles complex logical routing; non-thinking mode powers fast, streaming responses to end-users or downstream systems.

Data control & security

Self-hosting architecture means no model queries phone home; all inference and fine-tuning stay in your environment. No logs on external servers, no data residency risk. Not a security guarantee—still requires secure ops practices (network isolation, access control, audit logging). Compliance benefit comes from control, not the model itself.

Hardware footprint

**Estimate (unquantized, fp16)**: ~8–10 GB VRAM. **4-bit quantized (this variant)**: ~2.5–3.5 GB. **Inference speed**: vLLM on single A100 ~50–100 tokens/sec (thinking); non-thinking ~150–250 tokens/sec. Runs on consumer GPUs (RTX 4090, RTX 6000) or cloud (p3/g4dn instances).

Integration

Load via transformers or vLLM REST API. Apply chat template with `enable_thinking` flag to toggle reasoning. vLLM + SGLang expose OpenAI-compatible endpoints (port 8000), easing integration with existing tools (LangChain, LlamaIndex, internal dashboards). Thinking mode outputs `<think>…</think>` blocks—parse or hide in UI. Batch inference via vLLM for cost efficiency.

When it's not the right fit

  • Real-time latency critical: thinking mode adds 2–5s per response; non-thinking is faster but still slower than distilled 1B–3B models.
  • Cost-per-inference must compete with cached API calls: self-hosting eliminates per-token charges but requires upfront infrastructure + ops overhead.
  • Very long context (>32K) with frequent reasoning: YaRN extends to 131K natively, but thinking mode at max length is computationally expensive; may require batching.
  • Unsupported use-case: model lacks vision/multimodal; text-only.

Alternatives to consider

Llama 3.2 (1B–3B)

Smaller, faster, lower VRAM; no thinking mode. Better for latency-sensitive ops if reasoning isn't critical. No commercial fine-tuning restrictions.

Mistral 7B

Larger dense model, stronger on long-context ops (32K native). No reasoning mode; trade speed for raw capability. Well-established in enterprise stacks.

DeepSeek-R1 (7B–671B family)

Reasoning-first architecture, similar thinking/non-thinking split. Comparable or better reasoning; larger variants exceed Qwen3-4B capability. Requires more VRAM.

FAQ

Can I fine-tune this model on my own internal data and keep it private?

Yes. Apache 2.0 permits fine-tuning. Use Unsloth to reduce training cost (3x faster, 70% less memory), then export to Ollama or deploy via vLLM. Model and fine-tuned weights stay in your environment—no licensing fee for private use.

Can I use this commercially (e.g., build a SaaS product around it)?

Apache 2.0 is permissive; yes, commercial use is allowed. You must include the license and attribution. Verify with legal if embedding in a customer-facing product; no known restrictions, but always review original Qwen3 license terms for edge cases.

How do I switch between thinking and non-thinking modes?

Set `enable_thinking=True` (default) or `False` in `tokenizer.apply_chat_template()`. For vLLM/SGLang APIs, pass the flag in your request. Thinking mode uses temperature 0.6, top_p 0.95; non-thinking can use higher temperatures for variety.

What does the '4-bit' in the model name mean, and is this variant production-ready?

4-bit quantization (via bitsandbytes) compresses weights to ~4 bits, reducing VRAM by ~50% with minimal accuracy loss. This Unsloth variant is optimized for this compression. Production-ready: yes, if you test on your ops workflows first. Some rare edge-cases may show degradation; benchmark on your use-case.

Build Private Reasoning AI for Your Ops

Qwen3-4B runs fully in your environment—no external APIs, no vendor lock-in. LLM.co helps you fine-tune on internal workflows and integrate reasoning into custom apps. Let's architect your private AI stack.