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
sra-riskgate 0.15.0 is live on PyPI
Browse files
README.md
CHANGED
|
@@ -184,10 +184,10 @@ Pass the payment's own text as `untrusted_text` so self-asserted claims are held
|
|
| 184 |
|
| 185 |
## 📦 Python SDK: One Call Before Every Payment (PyPI)
|
| 186 |
|
| 187 |
-
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. From 0.13.0, Circle Gateway batched x402 payments (nanopayments) are checked: an authorization signed for Gateway's `GatewayWalletBatched` domain with Circle's GatewayWallet contract gets its own validity limit (default 8 days, since Gateway requires at least 3 and Circle's SDK signs for 7) and every payment check above, while a look-alike Gateway contract is held. Shown live on Arc Testnet: a Gateway payment approved and accepted by Circle, three unsafe ones stopped before signing. From 0.14.0, Circle Wallets (developer-controlled) requests are checked before they are sent to Circle, which signs as soon as it accepts them: transfers, contract executions (an `approve()` is held), typed-data and transaction signing, with `sign/message` and wallet upgrades always held. `guard_circle_wallets()` wraps Circle's Python SDK so blocked requests never reach Circle (`pip install "sra-riskgate[circle]"`). Shown live on Arc Testnet: a USDC payment from a Circle wallet approved and completed, an unlimited approval, an unknown payee and an unlimited permit stopped before reaching Circle.
|
| 188 |
|
| 189 |
```bash
|
| 190 |
-
pip install --upgrade "sra-riskgate>=0.
|
| 191 |
```
|
| 192 |
|
| 193 |
```python
|
|
|
|
| 184 |
|
| 185 |
## 📦 Python SDK: One Call Before Every Payment (PyPI)
|
| 186 |
|
| 187 |
+
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. From 0.13.0, Circle Gateway batched x402 payments (nanopayments) are checked: an authorization signed for Gateway's `GatewayWalletBatched` domain with Circle's GatewayWallet contract gets its own validity limit (default 8 days, since Gateway requires at least 3 and Circle's SDK signs for 7) and every payment check above, while a look-alike Gateway contract is held. Shown live on Arc Testnet: a Gateway payment approved and accepted by Circle, three unsafe ones stopped before signing. From 0.14.0, Circle Wallets (developer-controlled) requests are checked before they are sent to Circle, which signs as soon as it accepts them: transfers, contract executions (an `approve()` is held), typed-data and transaction signing, with `sign/message` and wallet upgrades always held. `guard_circle_wallets()` wraps Circle's Python SDK so blocked requests never reach Circle (`pip install "sra-riskgate[circle]"`). Shown live on Arc Testnet: a USDC payment from a Circle wallet approved and completed, an unlimited approval, an unknown payee and an unlimited permit stopped before reaching Circle. From 0.15.0, a payee that imitates one of your known payees (address poisoning: the same first and last characters, such as `0x2ffb…b7ee` for `0x2ffb88…472deb7ee`) is rejected as `LOOKALIKE_RECIPIENT`, naming the payee it imitates.
|
| 188 |
|
| 189 |
```bash
|
| 190 |
+
pip install --upgrade "sra-riskgate>=0.15.0"
|
| 191 |
```
|
| 192 |
|
| 193 |
```python
|