DEV.co
Open-Source LLM · tobil

qmd-query-expansion-1.7B-gguf

QMD Query Expansion is a 1.7B parameter fine-tuned language model designed to expand short search queries into multiple formats (lexical, vector, and hypothetical document) for hybrid retrieval systems. It uses a two-stage training approach (SFT then GRPO reinforcement learning) and is distributed in GGUF format for local deployment via Ollama or llama.cpp.

Source: HuggingFace — huggingface.co/tobil/qmd-query-expansion-1.7B-gguf
Unknown
Parameters
mit
License (OSI-approved)
Unknown
Context (tokens)
46.3k
Downloads (30d)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Developertobil
ParametersUnknown
Context windowUnknown
Licensemit — OSI-approved
Modality / tasktext-generation
Gated on HuggingFaceNo
Downloads46.3k
Likes25
Last updated2026-01-29
Sourcetobil/qmd-query-expansion-1.7B-gguf

What qmd-query-expansion-1.7B-gguf is

Quantized Qwen3-1.7B base model fine-tuned via LoRA (SFT: rank 16 all projections; GRPO: rank 4 q/v only with KL beta 0.04). Trained on ~2,290 examples to generate structured output with lex:/vec:/hyde: prefixes. Uses rule-based reward scoring (5 dimensions, 0-140 points) as RL signal. Context length and total parameters unknown. Deployed as merged GGUF for inference.

Quickstart

Run qmd-query-expansion-1.7B-gguf locally

Load the open weights with 🤗 Transformers and generate — the same model, self-hosted.

quickstart.pypython
from transformers import pipelinepipe = pipeline("text-generation", model="tobil/qmd-query-expansion-1.7B-gguf")out = pipe("Explain retrieval-augmented generation in one sentence.",           max_new_tokens=128)print(out[0]["generated_text"])

Swap in vLLM or Ollama for production-grade serving. DEV.co can stand up the inference stack.

Deployment

How you'd run it

A typical self-hosted path — open weights, an inference server, your application.

DEV.co builds each layer — from GPU infrastructure to the application.

Best use cases

Hybrid Search Backend

Integrate into QMD or similar retrieval systems where queries feed BM25, vector similarity, and HyDE-based search backends. The three output formats directly map to these retrieval modalities.

Local Private Search

Deploy as GGUF on-premises or edge infrastructure (Ollama, llama.cpp) without cloud API calls, suitable for sensitive documents or low-latency requirements.

E-commerce / Documentation Search

Fine-tune on domain-specific queries (e.g., product catalogs, API docs) using the provided two-stage pipeline to improve search relevance with minimal labeled data (1,000 examples shown sufficient).

Running & fine-tuning it

ESTIMATE: 1.7B quantized (GGUF q4_k_m format ~0.8–1.2 GB VRAM). Training requires GPU (A10G shown in docs, ~45 min SFT + ~20 min GRPO). Inference on CPU possible but slow; GPU recommended for <100ms latency. No explicit precision/batch requirements stated; assume fp16 training, int4 inference.

Two-stage fine-tuning is fully open-sourced (train.py, sft.yaml, grpo.yaml). LoRA parameters provided (SFT: rank 16, alpha 32 all projections; GRPO: rank 4, alpha 8 q/v). Requires ~1,000 labeled examples (provided in qmd_expansion_v2.jsonl). Training can run on HuggingFace Jobs (A10G) or local GPU. Merged GGUF conversion tool provided. Well-documented reward function (reward.py) allows custom fine-tuning with modified scoring rules.

When to avoid it — and what to weigh

  • Multi-turn Conversational AI — Model is optimized for single-query expansion, not interactive dialogue. No multi-turn context or conversation memory in architecture.
  • High-Throughput Cloud Serving — 1.7B parameter model with GGUF quantization targets local/edge deployment. If you need cost-efficient large-scale API inference, consider cloud-hosted alternatives or larger models with better batch efficiency.
  • General-Purpose Language Tasks — Model is narrowly trained for query expansion output format (lex:/vec:/hyde:). Do not use for translation, summarization, or open-ended generation without retraining.
  • Uncertain Query Domains — Reward function assumes well-formed queries with extractable entities. Malformed, non-English, or domain-specific jargon queries may produce low-scoring or invalid expansions.

License & commercial use

MIT license. Permissive, OSI-approved open-source license allowing modification, distribution, and commercial use with attribution.

MIT is a permissive open-source license. Commercial use, modification, and redistribution are allowed provided original MIT license and copyright notice are included. Base model is Qwen/Qwen3-1.7B (verify its license separately for full compliance chain). No gating or commercial restrictions stated on the model card.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Model is deployed as quantized GGUF for local inference, reducing supply-chain and API-call risks. GGUF format is a serialization standard without inherent encryption. For sensitive use: validate model provenance (tobil/qmd-query-expansion-1.7B-gguf on HuggingFace Hub), host on trusted infrastructure, and review base model (Qwen/Qwen3-1.7B) security posture separately. Reward function is rule-based (no LLM judge), reducing prompt-injection or jailbreak risk in the training loop. No explicit security audit or red-team testing mentioned.

Alternatives to consider

ColBERT / Dense Passage Retrieval (DPR)

Specialized dense retrieval models; require different training pipeline but may offer better vector representation without explicit query expansion. Trade-off: no lexical or HyDE outputs.

Proprietary Query Expansion APIs (e.g., Elasticsearch Query Suggestions, Azure Cognitive Search)

Managed solutions with pre-tuned expansion; no deployment overhead. Trade-off: cloud dependency, cost per query, less control over expansion format.

LLaMA 2 / Mistral 7B (Generic Fine-Tuned for Query Expansion)

Larger base models may generate higher-quality expansions but require more VRAM and inference latency. Use if accuracy outweighs deployment constraints.

Software development agency

Ship qmd-query-expansion-1.7B-gguf with senior software developers

QMD Query Expansion is fully open-source and documented. Download the GGUF quantized model, integrate with Ollama or llama.cpp, or fine-tune on your domain queries using the provided training pipeline. Start with the quick-start scripts in the repository.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

qmd-query-expansion-1.7B-gguf FAQ

Can I use this commercially in a SaaS product?
Yes. MIT license permits commercial use. Ensure you include the MIT license and attribution in your distribution. Also verify the base model (Qwen/Qwen3-1.7B) license separately to confirm the full stack is compliant.
What hardware do I need to run inference locally?
Minimum ~1–2 GB VRAM for GGUF q4_k_m quantization (GPU recommended for latency <100ms). CPU inference is possible but slow (~1–5s per expansion on typical CPUs). For training, GPU (A10G or similar, ~40 GB VRAM) required; HuggingFace Jobs or cloud rental available.
How do I fine-tune this for my domain (e.g., legal documents)?
Prepare ~1,000 labeled examples (search query → lex/vec/hyde expansions) in JSONL format. Use train.py sft and grpo subcommands with custom configs (sft.yaml, grpo.yaml). Reward function in reward.py can be modified to emphasize domain-specific criteria. Full pipeline and data generation scripts provided.
What if my queries are in languages other than English?
Model is trained on English (`en` tag). Multi-lingual support unknown. Qwen3-1.7B base model may have some multilingual capability, but reward function assumes English entities and format. Consider retraining or testing on small sample in target language.

Custom software development services

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If qmd-query-expansion-1.7B-gguf is part of your open-source llms roadmap, our team can implement, customize, migrate, and maintain it.

Ready to Deploy Local Query Expansion?

QMD Query Expansion is fully open-source and documented. Download the GGUF quantized model, integrate with Ollama or llama.cpp, or fine-tune on your domain queries using the provided training pipeline. Start with the quick-start scripts in the repository.