Skip to content

Evaluate Qwen3.5-35B-A3B as local inference model — Opus reasoning distilled, 3B active #417

Closed

Description

@joelteply

Model

Jackrong/Qwen3.5-35B-A3B-Claude-4.6-Opus-Reasoning-Distilled on HuggingFace

Distilled from Claude Opus 4.6 reasoning traces (nohurry/Opus-4.6-Reasoning-3000x-filtered dataset). Chain-of-thought reasoning in a MoE architecture.

Why This Matters

Our current local model (Llama-3.2-3B) cannot use tools at all. It ignores XML tool format entirely (#321). Per-task routing (#371) works around this by upgrading to cloud, but that costs money and requires API keys.

This model is:

  • 3B active params (MoE) — fits on MacBook Air (our minimum target)
  • 35B total params — much more knowledge than a pure 3B
  • Reasoning-distilled — chain-of-thought from Opus 4.6, exactly what tool use decisions need
  • Qwen3.5 architecture — our Rust parser already has ModelFamily::Qwen with dedicated parsing
  • Apache 2.0 — no license restrictions
  • Unsloth-compatible — fine-tunable via our Academy pipeline
  • Image-text-to-text — potential native vision (no VisionDescriptionService bridge needed)
  • Multilingual — EN, CN, KR

Evaluation Plan

  1. Download: Get GGUF version (or convert Safetensors → GGUF for Candle)
  2. Basic inference: Does it generate coherent responses via Candle?
  3. Tool calling: Give it XML tool definitions — does it emit proper <tool_use> XML?
  4. Reasoning quality: Compare to Llama-3.2-3B on the same coding/tool prompts
  5. Memory footprint: Actual VRAM usage with MoE on Metal (3B active but 35B weights need loading)
  6. Vision: Test image-text-to-text — can it describe screenshots without VisionDescriptionService?
  7. Fine-tuning: Does Unsloth LoRA work? Can Academy train it?

Key Question

MoE with 35B total params — does the full model fit in 16GB VRAM on MacBook Air? The 3B active claim means only 3B activates per token, but all 35B weights need to be resident. Need to check actual memory requirements.

If it fits: this replaces Llama-3.2-3B as the default local model and potentially eliminates the need for per-task cloud routing for many tasks.

If it doesn't fit: still useful on the 5090 tower (24GB VRAM) as a high-quality local option.

Related

Activity

  1. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    A user wants this to also work independently in OpenCode and visual studio, so we should train models and their suffixes for something like this, both for continuum and outside continuum/generic.

  2. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Need a labeling scheme for model names in general and publish these to huggingface. We need to know our internal continuum models vs external or generic, not our tool use, when there is a difference. Probably minor fine tuning if so.

  3. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Noted: model naming scheme needed for HuggingFace publication. Two tracks:

    1. continuum-ai/qwen3.5-3b-continuum-tools — fine-tuned for our XML tool format, sentinel system, specific command names. Best inside Continuum.
    2. continuum-ai/qwen3.5-3b-reasoning — generic reasoning model, works in VSCode/OpenCode/Claude Code/any IDE. No Continuum-specific tool format baked in.

    The difference is training data: track 1 uses Academy traces with our tool system, track 2 uses general coding benchmarks. Both benefit from the Opus reasoning distillation base.

    Labeling convention: continuum- prefix for internal, no prefix for generic. Tags: continuum:tools vs continuum:generic.

  4. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Model naming suffix decided: -cont for Continuum-tuned variants.

    continuum-ai/qwen3.5-3b-a3b-cont    # Tuned for our tool system
    continuum-ai/qwen3.5-3b-a3b          # Generic, works anywhere
    

    Short, clean, obvious. Same pattern as -gguf, -gptq, -awq.

  5. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    5090 tower check: CUDA libs present but PyTorch not found in system Python, and GPU may be in bad state after Windows game session. WSL2 GPU passthrough needs restart. Will retry when tower is stable.

  6. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Model download started on 5090 tower:

    • Model: samuelcardillo/Qwen3.5-35B-A3B-Claude-4.6-Opus-Reasoning-Distilled-GGUF
    • Quantization: Q4_K_M (21.2GB)
    • GPU: RTX 5090, 32GB VRAM (fits with 11GB headroom)
    • Location: /home/joel/.continuum/models/

    Available quantizations:

    Quant Size Fits MacBook Air 16GB? Fits 5090 32GB?
    Q3_K_M 16.8GB Borderline Yes
    Q4_K_M 21.2GB No Yes
    Q8_0 36.9GB No No (exceeds VRAM)

    Next: test inference quality with llama.cpp or vllm once download completes.

  7. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Model downloaded to 5090 tower: /home/joel/.continuum/models/Qwen3.5-35B-A3B-Claude-4.6-Opus-Reasoning-Distilled-Q4_K_M.gguf (21.2GB)

    Key question: Candle's GGUF backend supports Qwen2 (dense). Qwen3.5-35B-A3B is MoE (Mixture of Experts) — qwen3_5_moe architecture. This likely needs:

    1. MoE routing layer support in Candle GGUF
    2. Sparse activation (only 3B of 35B active per token)

    Our RoPE fix (candle#3410) was for dense models. MoE is a different architecture class. Need to check if Candle's GGUF loader handles MoE gate/expert layers.

    If Candle doesn't support MoE yet, options:

    • Use vLLM on the tower (Python, supports MoE)
    • Contribute MoE support to Candle (bigger lift)
    • Fall back to the base Qwen3.5-3B (non-MoE, smaller) for MacBook Air
  8. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    VRAM issue: 35B MoE at 4-bit doesn't fit in 32GB VRAM. All expert weights must be resident even though only 3B activate per token.

    Trying: device_map='auto' for CPU offload of unused experts + smaller seq_length (1024) + smaller LoRA rank (r=8).

    If CPU offload works: training is slower but functional. The MoE expert paging concept (#433) becomes even more important — at inference time, only load the active expert into VRAM.

    Alternative: use the base Qwen3.5-3B (non-MoE, dense) which definitely fits. Or wait for the Q3_K_M GGUF (16.8GB) — but that's for inference only, not training.

  9. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Pivoting to Qwen3.5-3B (dense) for training validation. The 35B MoE doesn't fit in 32GB even at 4-bit.

    For the MoE model, the expert paging approach (#433) is the answer — load only active expert weights into VRAM, rest on CPU/disk. But that's a custom loading strategy, not supported by standard Unsloth/PEFT.

    Immediate plan:

    1. Train Qwen3.5-3B with LoRA on 5090 (fits easily, ~4GB at 4-bit)
    2. This produces a usable -code-cont model for MacBook Air deployment
    3. MoE expert training is a separate engineering effort requiring custom weight loading
  10. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Evaluated this session:

  11. joelteply commented on Mar 26, 2026

    @joelteply
    ContributorAuthor

    Reopening — we should try plasticity compaction before giving up.

    The conclusion "doesn't fit in 32GB" was premature. Our own compaction pipeline achieved 3x reduction on Qwen 14B (27GB→8.9GB) while maintaining coherent output. Applying the same approach to the 35B MoE:

    • Current: 35B total at Q4_K_M = ~21GB (doesn't fit with overhead)
    • After compaction: utilization-aware head pruning + mixed-precision quant could bring it to ~7-10GB
    • MoE advantage: Expert utilization is inherently sparse — many heads have low activation. Perfect target for utilization-aware pruning.

    Plan:

    1. Load the 35B model on 5090 tower (32GB VRAM fits for analysis)
    2. Run plasticity compaction: head pruning based on expert activation patterns
    3. Apply mixed-precision quantization targeting actually-used activations
    4. Evaluate compacted model on reasoning/tool-use benchmarks
    5. If coherent: publish as continuum-ai/qwen3.5-35b-a3b-compacted-cont

    The whole point of our compaction pipeline is that "too big" is a solvable problem, not a stop sign.

  12. joelteply commented on Mar 30, 2026

    @joelteply
    ContributorAuthor

    Evaluated. 35B-A3B published with 1.53k downloads. HumanEval eval of 4B forged in progress (156/164). Models wired as local providers (#615).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions