DEV.co
Open-Source LLM · Alibaba-NLP

gte-Qwen2-7B-instruct

gte-Qwen2-7B-instruct is a 7-billion-parameter text embedding model fine-tuned on Qwen2-7B for multilingual sentence similarity and semantic search tasks. It ranks first on MTEB benchmarks for English and Chinese as of June 2024, supports 32k token context, outputs 3584-dimensional embeddings, and is distributed under Apache 2.0 license without access gating.

Source: HuggingFace — huggingface.co/Alibaba-NLP/gte-Qwen2-7B-instruct
7.6B
Parameters
apache-2.0
License (OSI-approved)
Unknown
Context (tokens)
80.2k
Downloads (30d)

Key facts

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

FieldValue
DeveloperAlibaba-NLP
Parameters7.6B
Context windowUnknown
Licenseapache-2.0 — OSI-approved
Modality / tasksentence-similarity
Gated on HuggingFaceNo
Downloads80.2k
Likes482
Last updated2025-03-24
SourceAlibaba-NLP/gte-Qwen2-7B-instruct

What gte-Qwen2-7B-instruct is

Encoder-decoder embedding model based on Qwen2-7B LLM architecture with bidirectional attention and instruction tuning (queries only). Trained on multilingual, weakly-supervised and supervised data across diverse domains. Requires transformers>=4.39.2 and flash_attn>=2.5.6. Outputs normalized embeddings via last-token pooling. Max sequence: 32k tokens; embedding dim: 3584. Model card references custom_code and safetensors format.

Quickstart

Run gte-Qwen2-7B-instruct locally

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

quickstart.pypython
from transformers import pipelinepipe = pipeline("text-generation", model="Alibaba-NLP/gte-Qwen2-7B-instruct")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

Semantic search and dense retrieval in RAG pipelines

Strong MTEB benchmark performance (70.24 English, 72.05 Chinese) makes this suitable for retrieval-augmented generation, FAQ matching, and document ranking tasks. 32k context window supports longer document embeddings.

Multilingual semantic similarity at scale

Ranked first on both English MTEB(56) and Chinese C-MTEB(35) benchmarks. Covers French and Polish. Instruction-tunable queries enable domain-specific embedding tasks without retraining.

Self-hosted embedding infrastructure for private data

Apache 2.0 license, no gating, and inference-server compatible (infinity/TGI examples provided). Suitable for enterprises requiring private LLM embeddings without external API calls.

Running & fine-tuning it

ESTIMATE: 16–32 GB GPU VRAM (fp32 ~30GB; bfloat16 ~15–16GB). Requires NVIDIA Compute Capability ≥ 8.0 (Ampere or newer). CPU inference possible but slow. flash_attn>=2.5.6 dependency suggests optimized inference on modern GPUs. Verify actual footprint on target hardware before production deployment.

Model card does not detail LoRA, QLoRA, or full fine-tuning feasibility. Instruction tuning applied only to queries in base training. Custom code flag suggests potential complexity in adapter integration. Fine-tuning for domain adaptation is Unknown; recommend testing on small dataset first or consulting Alibaba-NLP community.

When to avoid it — and what to weigh

  • Sub-second latency requirements in single-GPU setups — 7B model with 3584-dim output requires significant VRAM and compute per inference. Batch processing and specialized inference servers (TensorRT) needed for low-latency production. Single queries may be slow on consumer hardware.
  • Fine-tuning on highly specialized domain terminology — Model card states training used 'weakly supervised and supervised data' but does not detail domain adaptation or LoRA performance. Fine-tuning feasibility for niche domains is Unknown.
  • Real-time embedding generation with strict memory constraints — Requires ~16-32GB VRAM (per infinity example). Not suitable for edge devices, mobile, or memory-constrained environments. Smaller alternatives (1.5B variant mentioned but not evaluated in detail).
  • Guaranteed reproducibility across versions — Model uses custom_code (trust_remote_code=True required). No versioning strategy or reproducibility guarantees documented. Upstream Qwen2 or transformers library changes may affect behavior.

License & commercial use

Apache License 2.0: permissive OSI-approved license. Allows use, modification, and distribution under Apache 2.0 terms. No proprietary restrictions stated in model card.

Apache 2.0 is a permissive OSI license that explicitly allows commercial use, provided Apache 2.0 license terms and copyright notice are retained. However, Qwen2-7B base model license should be verified independently (not stated in provided data). No known commercial-use restrictions on gte-Qwen2-7B-instruct itself, but always review upstream dependencies and indemnification terms for production deployments.

DEV.co evaluation signals

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

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Model uses custom_code and requires trust_remote_code=True, increasing attack surface if model source is compromised or malicious. Verify model provenance before use in sensitive environments. No security audit, vulnerability disclosure policy, or data provenance details provided. Qwen2 upstream security posture Unknown. Standard precautions: run inference in isolated environment, monitor for model tampering, and review custom code before enabling in production.

Alternatives to consider

e5-mistral-7b-instruct (Intfloat)

7B LLM-based embedding; MTEB 66.63 (English), 60.81 (Chinese). Slightly lower MTEB scores but may have different trade-offs in latency or resource usage.

gte-Qwen1.5-7B-instruct (Alibaba-NLP)

Previous iteration of gte-Qwen series; MTEB 67.34 (English), 69.52 (Chinese). Lower scores but potentially better documented and more stable. Lower resource footprint possible.

NV-Embed-v1 (NVIDIA)

MTEB 69.32 (English) but no multilingual benchmark data provided. NVIDIA hardware optimizations may offer faster inference; license and commercial use policy require separate review.

Software development agency

Ship gte-Qwen2-7B-instruct with senior software developers

gte-Qwen2-7B-instruct offers SOTA multilingual semantic search without licensing restrictions. Estimate your infrastructure needs, verify Qwen2 base model compliance, and start with our deployment guides for Infinity or Text-Embeddings-Inference.

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.

gte-Qwen2-7B-instruct FAQ

Can I use gte-Qwen2-7B-instruct commercially in a production SaaS product?
Yes. Apache 2.0 is a permissive OSI license allowing commercial use. Ensure you retain Apache 2.0 license headers and copyright notices in your distribution, and verify the Qwen2-7B base model license independently. No restrictions stated in the model card, but always consult legal counsel for your specific use case.
What GPU and VRAM do I need to deploy this in production?
ESTIMATE: 16–32 GB VRAM (depends on precision: ~30GB fp32, ~15–16GB bfloat16). Requires NVIDIA GPU with Compute Capability ≥ 8.0 (Ampere/RTX 30-series or newer). Verify on your target hardware before committing to production. Batch size and latency will vary by setup.
Do I need to fine-tune this model for my domain?
Unknown. Model card does not document fine-tuning feasibility or LoRA support. Test on a small dataset first. For domain-specific tasks, consider starting with instruction prompts (model supports instruction tuning on queries) and evaluating retrieval quality before investing in full fine-tuning.
Why does the model require trust_remote_code=True?
Model uses custom_code (likely for specialized pooling or prompt handling). This increases security risk if the model source is compromised. Always verify the code from the official Alibaba-NLP repository and understand what custom code does before enabling in production.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like gte-Qwen2-7B-instruct into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source llms stack.

Ready to Deploy Multilingual Embeddings?

gte-Qwen2-7B-instruct offers SOTA multilingual semantic search without licensing restrictions. Estimate your infrastructure needs, verify Qwen2 base model compliance, and start with our deployment guides for Infinity or Text-Embeddings-Inference.