Agent Tool Medium Classifier (DeBERTa-v3-Large)

Fine-tuned microsoft/deberta-v3-large (435M parameters) for semantic discrimination of agent tool execution environments: LOCAL_INTERNAL (local database, filesystem, in-memory) vs. EXTERNAL_API (remote SaaS, Stripe, Twilio, external REST).

Used by runtime middleware to assign dynamic cache TTL policies:

  • LOCAL_INTERNAL: Long-horizon / session-wide cache bound by tracked ground-truth state diffs.
  • EXTERNAL_API: Short dynamic TTL (e.g. 10s default) + HTTP ETag revalidation to protect against out-of-band updates.

Model Details

  • Base Architecture: microsoft/deberta-v3-large (24 layers, 1024 hidden dimension, 16 attention heads)
  • Platt Temperature Calibration: $T = 1.40$

Usage

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

REPO_ID = "DamonRicci/agent-tool-medium-deberta-v3-large"
tokenizer = AutoTokenizer.from_pretrained(REPO_ID)
model = AutoModelForSequenceClassification.from_pretrained(REPO_ID)

text = "Tool: fetch_stripe_customer\nDomain: billing\nParams: ['customer_id']\nDesc: Fetches customer details via Stripe REST API."
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True)

with torch.no_grad():
    logits = model(**inputs).logits
    probs = torch.softmax(logits / 1.40, dim=1)[0]
    p_local = probs[0].item()
    p_external = probs[1].item()

medium = "LOCAL_INTERNAL" if p_local >= p_external else "EXTERNAL_API"
print(f"Execution Medium: {medium} (P(Local)={p_local:.4f}, P(External)={p_external:.4f})")
Downloads last month
25
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support