bagpipejerry / clara-qwen3-4b

huggingface.co
Total runs: 24
24-hour runs: 0
7-day runs: 14
30-day runs: 18
Model's Last Updated: December 05 2025
feature-extraction

Introduction of clara-qwen3-4b

Model Details of clara-qwen3-4b

CLaRa: Continuous Latent Reasoning Agent

This is a trained CLaRa model based on Qwen/Qwen3-4B-Instruct-2507.

Model Description

CLaRa (Bridging Retrieval and Generation with Continuous Latent Reasoning) is a system that unifies retrieval and generation into a shared continuous space.

Usage

Since this model relies on custom modeling code, you must use trust_remote_code=True .

from transformers import AutoModel, AutoTokenizer
import torch

model_id = "bagpipejerry/clara-qwen3-4b"

# Load model
# Note: device_map="auto" is recommended for large models
model = AutoModel.from_pretrained(model_id, trust_remote_code=True, device_map="auto")

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

# Example 1: Single Document QA
question = "What is CLaRa?"
documents = [["CLaRa is a framework that bridges retrieval and generation with continuous latent reasoning."]]

outputs = model.generate_from_text(
    questions=[question], 
    documents=documents,
    tokenizer=tokenizer,
    max_new_tokens=100
)
print(outputs[0])

# Example 2: Multi-Document Retrieval & Reranking (Stage 3 capability)
print("\n" + "="*60)
print("📝 Example 2: Multi-Document Retrieval & Reranking")
print("="*60)

test_questions_multi = ["How does CLaRa compress documents?"]
test_documents_multi = [[
    "CLaRa uses a compression pretraining approach called KPCP framework with QA pairs and paraphrases.",
    "The compressor is trained to compress documents into continuous latent representations while retaining key semantics.",
    "CLaRa achieves 32x-64x compression rates through its three-stage training pipeline.",
    "The framework uses DeepSpeed ZeRO-2 for distributed training across multiple GPUs.",
]]

outputs_multi, topk_indices = model.generate_from_questions(
    questions=test_questions_multi,
    documents=test_documents_multi,
    tokenizer=tokenizer,
    max_new_tokens=100,
    temperature=0.7,
)

print(f"Question: {test_questions_multi[0]}")
print(f"Candidate Documents: {len(test_documents_multi[0])} docs")
print(f"Top-K Selected Indices: {topk_indices[0].tolist() if torch.is_tensor(topk_indices[0]) else topk_indices[0]}")
print(f"CLaRa Response: {outputs_multi[0]}")
Citation

If you use this model, please cite the CLaRa paper/project.

Runs of bagpipejerry clara-qwen3-4b on huggingface.co

24
Total runs
0
24-hour runs
0
3-day runs
14
7-day runs
18
30-day runs

More Information About clara-qwen3-4b huggingface.co Model

More clara-qwen3-4b license Visit here:

https://choosealicense.com/licenses/apache-2.0

clara-qwen3-4b huggingface.co

clara-qwen3-4b huggingface.co is an AI model on huggingface.co that provides clara-qwen3-4b's model effect (), which can be used instantly with this bagpipejerry clara-qwen3-4b model. huggingface.co supports a free trial of the clara-qwen3-4b model, and also provides paid use of the clara-qwen3-4b. Support call clara-qwen3-4b model through api, including Node.js, Python, http.

bagpipejerry clara-qwen3-4b online free

clara-qwen3-4b huggingface.co is an online trial and call api platform, which integrates clara-qwen3-4b's modeling effects, including api services, and provides a free online trial of clara-qwen3-4b, you can try clara-qwen3-4b online for free by clicking the link below.

bagpipejerry clara-qwen3-4b online free url in huggingface.co:

https://huggingface.co/bagpipejerry/clara-qwen3-4b

clara-qwen3-4b install

clara-qwen3-4b is an open source model from GitHub that offers a free installation service, and any user can find clara-qwen3-4b on GitHub to install. At the same time, huggingface.co provides the effect of clara-qwen3-4b install, users can directly use clara-qwen3-4b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

clara-qwen3-4b install url in huggingface.co:

https://huggingface.co/bagpipejerry/clara-qwen3-4b

Url of clara-qwen3-4b

Provider of clara-qwen3-4b huggingface.co

bagpipejerry
ORGANIZATIONS