Text Classification
Transformers
Safetensors
ONNX
English
deberta-v2
deberta-v3
prompt-routing
llm
text-embeddings-inference
Instructions to use rohitMukhi/prompt_complexity_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rohitMukhi/prompt_complexity_classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="rohitMukhi/prompt_complexity_classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("rohitMukhi/prompt_complexity_classifier") model = AutoModelForSequenceClassification.from_pretrained("rohitMukhi/prompt_complexity_classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from rohitMukhi/prompt_complexity_classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/rohitMukhi/prompt_complexity_classifier/resolve/main/README.md
- Command line
-
hf download hf://rohitMukhi/prompt_complexity_classifier/README.md
-
curl -L -o README.md https://huggingface.co/rohitMukhi/prompt_complexity_classifier/resolve/main/README.md
1.99 kB
| license: mit | |
| language: | |
| - en | |
| tags: | |
| - text-classification | |
| - deberta-v3 | |
| - prompt-routing | |
| - llm | |
| - onnx | |
| metrics: | |
| - accuracy | |
| - f1 | |
| library_name: transformers | |
| # DeBERTa-v3-base Prompt Complexity Classifier | |
| A high-performance, lightweight prompt complexity classifier built by fine-tuning `microsoft/deberta-v3-base`. This model categorizes incoming user queries into **3 distinct complexity tiers** to power intelligent prompt routing, optimizing latency and cost in custom AI gateways. | |
| ## 📊 Complexity Tiers | |
| * **`TIER_0` (Low Complexity)**: Simple direct lookups, basic factual queries, typos corrections, or short conversational greetings. (Routed to fast, lightweight models). | |
| * **`TIER_1` (Medium Complexity)**: Standard coding tasks, boilerplate generation, scoped bug fixes, or moderate multi-step reasoning. (Routed to balanced mid-tier models). | |
| * **`TIER_2` (High Complexity)**: Advanced software architecture design, deep multi-file debugging, heavy concurrent systems analysis, or complex agentic planning. (Routed to frontier models). | |
| --- | |
| ## 🚀 Quick Start (Python) | |
| You can easily load and use this model for inference using the Hugging Face `transformers` library: | |
| ```python | |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
| import torch | |
| # Load model and tokenizer | |
| model_id = "rohitMukhi/deberta-v3-prompt-complexity-classifier" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForSequenceClassification.from_pretrained(model_id) | |
| # Test prompt | |
| prompt = "Design a multi-tenant microservices architecture with Redis clustering and strict database isolation." | |
| # Tokenize and predict | |
| inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=256) | |
| with torch.no_grad(): | |
| logits = model(**inputs).logits | |
| predicted_class = torch.argmax(logits, dim=1).item() | |
| tier_labels = {0: "TIER_0 (Low)", 1: "TIER_1 (Medium)", 2: "TIER_2 (High)"} | |
| print(f"Predicted Complexity: {tier_labels[predicted_class]}") |