Text Generation
Transformers
Safetensors
PyTorch
ONNX
English
qtensorformer
qtf
q-tensorformer
qtensor
high-throughput-inference
tensor-train
tensor-networks
tensorrt-llm
vllm
continuous-batching
paged-attention
speculative-decoding
zero-svd
adaptive-computation
dynamic-neural-networks
kv-cache
kv-cache-quantization
attention-sinks
lyapunov-stability
control-theory
contextual-bandits
edge-ai
edge-inference
on-device-ai
model-compression
hopper-h100
blackwell-b200
jetson-orin
jetson-thor
grouped-query-attention
rotary-position-embeddings
custom_code
academic-paper
ieee
neurips
vit-ap-university
deepseek
deepseek-r1
reasoning
chain-of-thought
gsm8k
openai-compatible
fastapi
rest-api
sse-streaming
onnx-runtime
embedded-ai
hardware-telemetry
power-efficiency
green-ai
raspberry-pi
smollm2
qwen2.5
llama-3.2
apple-silicon
Instructions to use Premchan369/Q-TensorFormer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Premchan369/Q-TensorFormer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Premchan369/Q-TensorFormer", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Premchan369/Q-TensorFormer", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Premchan369/Q-TensorFormer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Premchan369/Q-TensorFormer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Premchan369/Q-TensorFormer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Premchan369/Q-TensorFormer
- SGLang
How to use Premchan369/Q-TensorFormer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Premchan369/Q-TensorFormer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Premchan369/Q-TensorFormer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Premchan369/Q-TensorFormer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Premchan369/Q-TensorFormer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Premchan369/Q-TensorFormer with Docker Model Runner:
docker model run hf.co/Premchan369/Q-TensorFormer
Premchandyadav369
Complete 16-phase scientific hardening, strict checkpoint audit, empirical benchmarks, and documentation
7aefd9e |
Download reports/CONFIG_PROVENANCE.md from Premchan369/Q-TensorFormer: direct link, hf CLI and curl.
- Browser
- Download file 3.51 kB
-
https://huggingface.co/Premchan369/Q-TensorFormer/resolve/main/reports/CONFIG_PROVENANCE.md
- Command line
-
hf download hf://Premchan369/Q-TensorFormer/reports/CONFIG_PROVENANCE.md
-
curl -L -o CONFIG_PROVENANCE.md https://huggingface.co/Premchan369/Q-TensorFormer/resolve/main/reports/CONFIG_PROVENANCE.md
3.51 kB
| # Phase Two — Configuration Provenance Report | |
| ## 1. Configuration File & Class Inventory | |
| | Config Source | Class / Schema | Intended Model Family | Key Hyperparameters | | |
| | :--- | :--- | :--- | :--- | | |
| | `src/config.py` | `src.config.ModelConfig` | Family 3 (`src.models.QTensorFormer`, `src.models.DenseBaseline`) | `d_model=128`, `n_heads=4`, `n_layers=2`, `ff_multiplier=4`, `max_seq_len=128`, `vocab_size=10000`, `tt_rank=8`, `tt_min_rank=2`, `n_qubits=4`, `use_quantum=True` | | |
| | `configuration_qtensorformer.py` | `QTensorFormerConfig(PretrainedConfig)` | Family 4 (`modeling_qtensorformer.QTensorFormerForCausalLM`) | `vocab_size=32000`, `hidden_size=2048`, `num_hidden_layers=16`, `num_attention_heads=16`, `num_key_value_heads=4`, `intermediate_size=5632`, `tt_ranks=[1, 16, 16, 1]`, `hysteresis_threshold=0.15` | | |
| | `config.json` | JSON serialized `QTensorFormerConfig` | Family 4 (`AutoConfig` / `AutoModelForCausalLM`) | `model_type="qtensorformer"`, `vocab_size=32000`, `hidden_size=2048`, `num_hidden_layers=16`, `num_attention_heads=16`, `num_key_value_heads=4`, `tt_ranks=[1, 16, 16, 1]` | | |
| | `qtensorformer_small.pt["config"]` | Embedded Python `dict` | Legacy external TensorLy container (`/app/qtensorformer`) | `vocab_size=10000`, `hidden_dim=128`, `intermediate_size=256`, `n_heads=4`, `n_layers=3`, `seq_len=64`, `tt_rank=4`, `n_qubits=4` | | |
| | `q_tensor_former.py` | `q_tensor_former.CFG` | Family 1 (v1 prototype) | `d_model=64`, `n_heads=4`, `n_layers=2`, `vocab_size=1000`, `tt_rank=8` | | |
| | `q_tensor_former_v2.py` | `q_tensor_former_v2.Config` | Family 2 (v2 prototype) | `d_model=128`, `n_heads=4`, `n_layers=2`, `vocab_size=10000`, `tt_rank=8` | | |
| --- | |
| ## 2. Root Cause of Historical Config Construction Failures | |
| Earlier external benchmark notebooks encountered errors involving `backend_type` and unresolved attributes (`d_model`, `dropout`, `n_heads`, `n_layers`) due to two distinct issues: | |
| 1. **Passing the embedded dictionary inside `qtensorformer_small.pt["config"]` directly into `src.config.ModelConfig(**ckpt["config"])`:** | |
| - `qtensorformer_small.pt["config"]` uses keys `hidden_dim`, `intermediate_size`, `seq_len`, `quantum_layers`, `quantum_ratio`, `use_quantum_attention`, `use_adaptive_rank`, `use_selective_routing`, `r_min`, `r_max`, `alpha`, which do not match `src.config.ModelConfig` (`d_model`, `ff_multiplier`, `max_seq_len`, `n_quantum_layers`, `quantum_sparsity`, `tt_min_rank`). | |
| 2. **Mixing Hugging Face `QTensorFormerConfig` (`hidden_size`, `num_hidden_layers`, `num_attention_heads`) with `src.models.QTensorFormer` (`d_model`, `n_layers`, `n_heads`):** | |
| - `src.models.QTensorFormer` expects `src.config.ModelConfig`, whereas `modeling_qtensorformer.QTensorFormerForCausalLM` expects `QTensorFormerConfig`. | |
| --- | |
| ## 3. Source-Level Resolution & Guardrails | |
| 1. `src.config.validate_model_config(config, model_class)` explicitly checks that `d_model`, `n_heads`, `n_layers`, `ff_multiplier`, `max_seq_len`, and `vocab_size` exist on the supplied config object and raises `ValueError("ConfigurationValidationError: ...")` rather than guessing defaults. | |
| 2. `src.models.QTensorFormer` safely resolves optional `backend_type = getattr(config, "backend_type", "classical_surrogate")` while requiring core architectural dimensions to be explicitly defined. | |
| 3. `QTensorFormerConfig` in `configuration_qtensorformer.py` exposes read-only property bridges (`.d_model`, `.n_layers`, `.n_heads`, `.n_kv_heads`, `.max_seq_len`) and sets `keys_to_ignore_at_loading = []`. | |