How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="KRISHNAPURI/q-trust-codebert")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("KRISHNAPURI/q-trust-codebert")
model = AutoModelForSequenceClassification.from_pretrained("KRISHNAPURI/q-trust-codebert", device_map="auto")
Quick Links

Q-Trust CodeBERT — crypto-usage discovery classifier

Binary code classifier that answers "does this code use cryptography, and which primitive?" — the discovery layer of the Q-Trust post-quantum migration project (humoge7502/q-trust on GitHub). Fine-tuned from huggingface/CodeBERTa-small-v1 on 12,462 real files (6,636 crypto-labeled, 34 repos, deterministic seed-42 split, repo-disjoint held-out set).

Measured results (never estimated)

Metric Value
Precision / Recall / F1 0.952 / 0.953 / 0.9525 (n=2,415)
Training 4 epochs, CUDA, scripts/train_qtrust_all.py --real --hf-epochs 3
Leakage audit Split reproduced bit-identically; 0.4% cross-repo dupes, bounded below the +0.11 F1 gain

Try it in the widget above, or in code:

from transformers import pipeline
clf = pipeline("text-classification", model="KRISHNAPURI/q-trust-codebert")
clf("EVP_PKEY_assign_RSA(pkey, rsa);")
# [{'label': 'LABEL_1', 'score': 0.99}]  # LABEL_1 = crypto usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tok = AutoTokenizer.from_pretrained("KRISHNAPURI/q-trust-codebert")
model = AutoModelForSequenceClassification.from_pretrained("KRISHNAPURI/q-trust-codebert")

Training data: KRISHNAPURI/q-trust-datasets (qtrust_ai/artifacts/real_datasets/code_corpus.json). Full lineage (config + seed + metrics): reports/training_report_real.json in KRISHNAPURI/q-trust-codebert sibling files, and qtrust_ai/artifacts/benchmark_comparison.json in the GitHub repo.

Scope and limits

This model finds crypto usage (recall 0.877 on CryptoAPI-Bench files); it is not a misuse detector and makes no SOTA claim. Sibling artifacts in this repo: GNN ranker (honest tie with the heuristic, τ-b 0.7168 vs 0.7210), RL agent (tie), side-channel detector (54 real trace sets). See REPORTS and the per-artifact notes in the repo card below.

Downloads last month
64
Safetensors
Model size
83.5M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for KRISHNAPURI/q-trust-codebert

Quantized
(4)
this model

Dataset used to train KRISHNAPURI/q-trust-codebert

Space using KRISHNAPURI/q-trust-codebert 1