Text Generation
Transformers
Safetensors
English
qwen3
stablecoin
payments
compliance
x402
eip-3009
eip-712
disputes
refunds
agents
agentkit
trl
web3
usdc
fraud-detection
financial-risk
qwen
mcp
ai-agents
prompt-injection
agentic-payments
payment-security
risk-assessment
ofac
conversational
Eval Results (legacy)
Eval Results
text-generation-inference
Instructions to use sriram1983007/SRA-RiskGate-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sriram1983007/SRA-RiskGate-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sriram1983007/SRA-RiskGate-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sriram1983007/SRA-RiskGate-4B") model = AutoModelForCausalLM.from_pretrained("sriram1983007/SRA-RiskGate-4B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sriram1983007/SRA-RiskGate-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sriram1983007/SRA-RiskGate-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sriram1983007/SRA-RiskGate-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sriram1983007/SRA-RiskGate-4B
- SGLang
How to use sriram1983007/SRA-RiskGate-4B 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 "sriram1983007/SRA-RiskGate-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sriram1983007/SRA-RiskGate-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "sriram1983007/SRA-RiskGate-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sriram1983007/SRA-RiskGate-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sriram1983007/SRA-RiskGate-4B with Docker Model Runner:
docker model run hf.co/sriram1983007/SRA-RiskGate-4B
Model card: Arc support (0.12.0) and EIP-7702 hold (0.12.1)
Browse files
README.md
CHANGED
|
@@ -163,7 +163,7 @@ If this is useful for your agent, a ❤️ like on this page helps others find i
|
|
| 163 |
| `check_address_sanctions` | Exact, offline match of up to 100 addresses against the bundled OFAC SDN snapshot | Nothing |
|
| 164 |
| `check_payment_rules` | The deterministic checks above for a USDC payment | Nothing |
|
| 165 |
| `check_x402_payment` | The same checks for an x402 payment requirement, before the agent signs | Nothing |
|
| 166 |
-
| `check_transaction` | The same checks for the exact transaction about to be signed (`to`, calldata, `value`); token approvals, other functions
|
| 167 |
| `check_x402_authorization` | The same checks for the x402 signature itself (the EIP-3009 `TransferWithAuthorization` typed data) before signing; expired, post-dated or long-lived authorizations and permits are held | Nothing |
|
| 168 |
| `check_payment_with_model` | Full review by SRA-RiskGate-4B over your policy, the payment and your verification results | This model served locally (for example with Ollama) |
|
| 169 |
|
|
@@ -179,17 +179,17 @@ Pass the payment's own text as `untrusted_text` so self-asserted claims are held
|
|
| 179 |
|
| 180 |
## 📦 Python SDK: One Call Before Every Payment (PyPI)
|
| 181 |
|
| 182 |
-
The `sra-riskgate` SDK runs fast deterministic checks before the model is involved: an offline match against the OFAC SDN list's crypto addresses (a dated snapshot, not a screening service), supported asset and chain, address and amount validation, a per-payment ceiling, USDC depeg in both directions, and a scan for payment text that claims its own verification. From 0.8.0 it can also hold the first payment to a new payee (`known_recipients`) and always reject addresses you block (`blocked_addresses`). It never raises on bad payment data: invalid payments are rejected and anything unexpected becomes `hold`. From 0.9.0, `check_transaction(tx, ...)` checks the exact transaction an agent is about to sign: a USDC `transfer` gets the same checks, and token approvals (including unlimited `approve()`), other functions, other contracts and native ETH are held. From 0.11.0, check_authorization(typed_data, ...) does the same for x402 payments, which the agent pays by signing an EIP-3009 authorization instead of sending a transaction: the signature must be for USDC on that chain, from the agent’s wallet, and valid for at most an hour by default, and the decoded payment then gets every check above.
|
| 183 |
|
| 184 |
```bash
|
| 185 |
-
pip install --upgrade "sra-riskgate>=0.
|
| 186 |
```
|
| 187 |
|
| 188 |
```python
|
| 189 |
from sra_riskgate import ActionDecision, check_payment
|
| 190 |
|
| 191 |
result = check_payment(
|
| 192 |
-
chain_id=1, # Ethereum; Base (8453)
|
| 193 |
sender="0x" + "a" * 40,
|
| 194 |
recipient="0x" + "b" * 40,
|
| 195 |
amount=5000.0, # USDC
|
|
|
|
| 163 |
| `check_address_sanctions` | Exact, offline match of up to 100 addresses against the bundled OFAC SDN snapshot | Nothing |
|
| 164 |
| `check_payment_rules` | The deterministic checks above for a USDC payment | Nothing |
|
| 165 |
| `check_x402_payment` | The same checks for an x402 payment requirement, before the agent signs | Nothing |
|
| 166 |
+
| `check_transaction` | The same checks for the exact transaction about to be signed (`to`, calldata, `value`); token approvals, other functions, native ETH and EIP-7702 delegations are held; on Arc, native USDC sends are checked as payments | Nothing |
|
| 167 |
| `check_x402_authorization` | The same checks for the x402 signature itself (the EIP-3009 `TransferWithAuthorization` typed data) before signing; expired, post-dated or long-lived authorizations and permits are held | Nothing |
|
| 168 |
| `check_payment_with_model` | Full review by SRA-RiskGate-4B over your policy, the payment and your verification results | This model served locally (for example with Ollama) |
|
| 169 |
|
|
|
|
| 179 |
|
| 180 |
## 📦 Python SDK: One Call Before Every Payment (PyPI)
|
| 181 |
|
| 182 |
+
The `sra-riskgate` SDK runs fast deterministic checks before the model is involved: an offline match against the OFAC SDN list's crypto addresses (a dated snapshot, not a screening service), supported asset and chain, address and amount validation, a per-payment ceiling, USDC depeg in both directions, and a scan for payment text that claims its own verification. From 0.8.0 it can also hold the first payment to a new payee (`known_recipients`) and always reject addresses you block (`blocked_addresses`). It never raises on bad payment data: invalid payments are rejected and anything unexpected becomes `hold`. From 0.9.0, `check_transaction(tx, ...)` checks the exact transaction an agent is about to sign: a USDC `transfer` gets the same checks, and token approvals (including unlimited `approve()`), other functions, other contracts and native ETH are held. From 0.11.0, check_authorization(typed_data, ...) does the same for x402 payments, which the agent pays by signing an EIP-3009 authorization instead of sending a transaction: the signature must be for USDC on that chain, from the agent’s wallet, and valid for at most an hour by default, and the decoded payment then gets every check above. From 0.12.0, Circle Arc is supported (5042 mainnet, 5042002 testnet): on Arc, USDC is the native asset, so a plain native send is checked as a USDC payment, read at 18 decimals and rounded up to a whole micro-USDC before the payment check. From 0.12.1, EIP-7702 code delegation is always held (`CODE_DELEGATION`): a type-4 transaction or any `authorizationList` hands the whole account to contract code, on every chain if signed with chain id 0, and `check_delegation()` holds a signed authorization before the agent signs it.
|
| 183 |
|
| 184 |
```bash
|
| 185 |
+
pip install --upgrade "sra-riskgate>=0.12.1"
|
| 186 |
```
|
| 187 |
|
| 188 |
```python
|
| 189 |
from sra_riskgate import ActionDecision, check_payment
|
| 190 |
|
| 191 |
result = check_payment(
|
| 192 |
+
chain_id=1, # Ethereum; Base (8453), Base Sepolia (84532), Arc (5042) and Arc Testnet (5042002) also supported
|
| 193 |
sender="0x" + "a" * 40,
|
| 194 |
recipient="0x" + "b" * 40,
|
| 195 |
amount=5000.0, # USDC
|