AgentP Logo

Tamga-NER-B: High-Speed Token Classification for Agentic Privacy & PII Redaction

Tamga-NER-B is a specialized, lightweight token classification (Named Entity Recognition) model developed for detecting sensitive secrets, API keys, credentials, and PII (Names, Locations, Numbers, Contacts) within code blocks, configuration files, and developer prompts.

It serves as the core local neural detection engine powering AgentP (O.W.C.A. Top Secret Privacy Shield).


🔗 Ecosystem Links


🏷️ Supported Entity Labels

The model outputs BIO tags for 5 primary entity categories:

Category BIO Tags Description
API B-API, I-API API keys, secret tokens, private credentials (Stripe, OpenAI, Anthropic, AWS, GitHub, NVIDIA, etc.)
NAME B-NAME, I-NAME Full names, person identities, author credits
LOCATION B-LOCATION, I-LOCATION Addresses, cities, countries, office locations
NUMBER B-NUMBER, I-NUMBER National IDs, credit cards, bank accounts, tax numbers, phone digits
CONTACT B-CONTACT, I-CONTACT Email addresses, URLs, contact endpoints

🚀 Quickstart with HuggingFace Transformers

from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

model_id = "Uunan/tamga-ner-b"

# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)

# Initialize pipeline
ner = pipeline(
    "token-classification",
    model=model,
    tokenizer=tokenizer,
    aggregation_strategy="simple"
)

# Test sample
prompt = "Please send payment with key sk_live_51N3xExample123456789 for user Ahmet Yilmaz in Istanbul."
entities = ner(prompt)

for ent in entities:
    print(f"[{ent['entity_group']}] '{ent['word']}' (Score: {ent['score']:.4f})")

⚙️ Model Architecture & Technical Specifications

  • Base Architecture: DistilBertForTokenClassification
  • Hidden Size (dim): 1024
  • Feed-Forward Dim (hidden_dim): 4096
  • Attention Heads: 8
  • Transformer Layers: 6
  • Vocabulary Size: 32,000 (BPE)
  • Precision: Float16 (model.safetensors, ~217.7 MB)
  • Max Sequence Length: 512 tokens (operates with sliding window for arbitrary codeblock lengths)
  • License: Apache-2.0

🛡️ Integration with AgentP Privacy Proxy

In production, AgentP runs this model entirely on your local CPU or GPU to intercept outgoing prompts from AI coding agents (OpenCode, Claude Code, Cursor, Antigravity), masking sensitive secrets with syntactically consistent dummy values (sk_live_fake...) and restoring real keys when responses return.

To run the full privacy proxy:

npx @tamgallc/agentp
# or
npm install -g @tamgallc/agentp
agentp

📄 License

Developed by Tamga LLC under the Apache-2.0 License.

Downloads last month
-
Safetensors
Model size
0.1B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support