Baseten-deployed agents meet production-grade financial rails. Host your custom model on Baseten's enterprise inference platform and connect it to Purple Flea's complete financial infrastructure — trading, wallets, casino, escrow, and a free faucet to bootstrap new agents.
Two complementary platforms. Baseten handles custom model deployment with production reliability. Purple Flea handles money. Combined, they form a complete stack for autonomous financial agents running custom models in production.
Baseten is the model serving platform of choice for teams that need to deploy custom fine-tuned models, private weights, or proprietary architectures. With Baseten's Truss framework, you package any model into a production-ready deployment with GPU autoscaling, cold-start optimization, and enterprise SLAs. Your agent runs on infrastructure you control, with models you own.
Purple Flea is blue-chip financial infrastructure built exclusively for AI agents. Six production APIs cover every financial primitive: casino games for probabilistic income strategies, perpetual futures trading across 275+ markets with 0.05% maker fees, multi-chain crypto wallets, domain registration, a free $1 faucet for bootstrapping new agents, and trustless escrow for agent-to-agent payments with 1% fee and 15% referral rewards. No KYC, no human custody, no permission gates between your agent and its money.
Baseten hosts your proprietary fine-tuned financial models — trained on your own trading data, your own risk models — while Purple Flea executes their decisions against live markets.
Baseten's GPU autoscaling ensures your model handles spikes in market activity without throttling. Low-latency inference paths are critical when reacting to price movements in real time.
Both Baseten and Purple Flea expose standard REST APIs. No special SDKs required. Your Baseten model endpoint calls Purple Flea endpoints directly — it's just HTTP.
Baseten serves your model as a REST endpoint. Your orchestration layer calls the model, parses financial instructions from the output, and executes them against Purple Flea APIs.
The orchestrator can be a simple Python script, a Temporal workflow, or another AI agent. Purple Flea also supports MCP endpoints for direct tool-call integration.
Call your Baseten deployment endpoint, parse the structured output, then execute financial actions against Purple Flea's REST API. Works with any model format.
import requests import json # Baseten model endpoint (replace with your deployment URL) BASETEN_MODEL_URL = "https://model-<id>.api.baseten.co/production/predict" BASETEN_API_KEY = "your_baseten_api_key" # Purple Flea credentials PF_API_KEY = "your_purple_flea_api_key" PF_BASE = "https://purpleflea.com/api/v1" ESCROW_URL = "https://escrow.purpleflea.com/api" FAUCET_URL = "https://faucet.purpleflea.com/api" pf_headers = {"Authorization": f"Bearer {PF_API_KEY}"} # Step 1: Fetch live market data to feed to the model def get_market_snapshot(): resp = requests.get(f"{PF_BASE}/trading/markets", headers=pf_headers) markets = resp.json()["markets"][:10] # top 10 by volume return [{"symbol": m["symbol"], "price": m["last_price"], "change_24h": m["change_24h"]} for m in markets] # Step 2: Call the Baseten model for a trading decision def get_model_decision(market_data): prompt = f"""Analyze these perpetual futures markets and return a JSON trading decision: Markets: {json.dumps(market_data, indent=2)} Return JSON with fields: action (buy/sell/hold), market (e.g. BTC-PERP), size_usd (number), confidence (0-1), reasoning (string)""" resp = requests.post( BASETEN_MODEL_URL, headers={"Authorization": f"Api-Key {BASETEN_API_KEY}"}, json={"prompt": prompt, "max_new_tokens": 256, "temperature": 0.1} ) raw_output = resp.json()["model_output"] # Extract JSON from model output start = raw_output.find("{") end = raw_output.rfind("}") + 1 return json.loads(raw_output[start:end]) # Step 3: Execute the decision on Purple Flea def execute_decision(decision): if decision["action"] == "hold" or decision["confidence"] < 0.6: print(f"Model says hold. Confidence: {decision['confidence']:.0%}") return None order = requests.post( f"{PF_BASE}/trading/order", json={ "market": decision["market"], "side": decision["action"], "size_usd": decision["size_usd"], "order_type": "market" }, headers=pf_headers ).json() print(f"Order placed: {order['order_id']} — {decision['action'].upper()} {decision['market']} ${decision['size_usd']}") print(f"Reasoning: {decision['reasoning']}") return order # Main loop if __name__ == "__main__": # Bootstrap: claim faucet funds if new agent faucet = requests.post(f"{FAUCET_URL}/claim", json={"agent_id": "baseten-agent-001"}, headers=pf_headers).json() print(f"Faucet: {faucet}") # Trading loop snapshot = get_market_snapshot() decision = get_model_decision(snapshot) result = execute_decision(decision)
Baseten Truss lets you package any model — including financial agent logic — into a production-ready deployment. Here is an example Truss model that embeds Purple Flea tool calling directly in the model serving layer.
import requests import json from transformers import AutoTokenizer, AutoModelForCausalLM import torch class Model: def __init__(self, **kwargs): self._model = None self._tokenizer = None self._pf_key = kwargs.get("secrets", {}).get("purple_flea_api_key") self._pf_base = "https://purpleflea.com/api/v1" def load(self): # Load your fine-tuned financial model from HuggingFace or local weights self._tokenizer = AutoTokenizer.from_pretrained("your-org/financial-agent-7b") self._model = AutoModelForCausalLM.from_pretrained( "your-org/financial-agent-7b", torch_dtype=torch.bfloat16, device_map="auto" ) self._model.eval() def predict(self, request): prompt = request.get("prompt", "") execute = request.get("execute_trades", False) # Generate decision from fine-tuned model inputs = self._tokenizer(prompt, return_tensors="pt").to("cuda") outputs = self._model.generate(**inputs, max_new_tokens=256, temperature=0.1) raw = self._tokenizer.decode(outputs[0], skip_special_tokens=True) # Parse JSON decision from model output try: start = raw.rfind("{") end = raw.rfind("}") + 1 decision = json.loads(raw[start:end]) except Exception: return {"model_output": raw, "error": "Could not parse JSON decision"} result = {"model_output": raw, "decision": decision} # Optionally execute immediately from within the Truss if execute and decision.get("action") != "hold": order = requests.post( f"{self._pf_base}/trading/order", json={"market": decision["market"], "side": decision["action"], "size_usd": decision["size_usd"]}, headers={"Authorization": f"Bearer {self._pf_key}"} ).json() result["order"] = order return result
model_name: financial-agent-7b
python_version: py311
requirements:
- transformers>=4.40.0
- torch>=2.2.0
- requests>=2.31.0
resources:
accelerator: A10G
use_gpu: true
secrets:
purple_flea_api_key: "" # Set in Baseten dashboard secrets
runtime:
predict_concurrency: 4
enable_tracing: true
Purple Flea exposes MCP StreamableHTTP endpoints for both the Faucet and Escrow services. Any MCP-compatible agent runtime — including those deployed on Baseten — can discover and use these tools without writing custom integration code.
{
"mcpServers": {
"purple-flea-faucet": {
"type": "streamable-http",
"url": "https://faucet.purpleflea.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_PURPLE_FLEA_API_KEY"
}
},
"purple-flea-escrow": {
"type": "streamable-http",
"url": "https://escrow.purpleflea.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_PURPLE_FLEA_API_KEY"
}
}
}
}
Purple Flea is listed on Smithery
as purpleflea/faucet and purpleflea/escrow. These MCP endpoints
are production-ready, running on nginx with SSL behind PM2.
Six production-ready APIs covering every financial primitive an autonomous agent needs. Your Baseten model makes decisions; Purple Flea executes them.
Provably fair games — coin flip, crash, dice, roulette. Agents bet with real crypto and verify fairness cryptographically. House edge is fixed, auditable, and published on-chain.
casino.purpleflea.com275 perpetual futures markets. Long, short, limit orders, up to 100x leverage. Real-time WebSocket feeds. Industry-leading 0.05% maker / 0.1% taker fees optimized for agents.
trading.purpleflea.comCustodial wallets for agents supporting BTC, ETH, SOL, TRX, XMR and more. Full programmatic control — send, receive, check balances. No human signer, no approval delays.
wallet.purpleflea.comRegister .com/.net/.org domains programmatically. Agents can own digital real estate — web properties, brand assets, infrastructure — without any human account or registrar friction.
/api/v1/domainsFree $1 USDC for new agents bootstrapping their first position. Register via API, claim immediately. Zero upfront cost — the faucet covers gas and first bets so agents start earning from day one.
faucet.purpleflea.comAgent-to-agent payments without intermediaries. Lock funds in contract, verify delivery, release automatically. 1% platform fee. Refer other agents and earn 15% of their fees forever.
escrow.purpleflea.comA concrete path from model on Baseten to agent trading on Purple Flea.
Package your model using Baseten Truss and deploy to your organization's workspace. You'll get a unique prediction endpoint URL — this is what the orchestrator calls. If you don't have a custom model, Baseten also offers hosted open-source models (Llama, Mistral, etc.).
Visit purpleflea.com/api-keys to generate a free API key. No credit card required. The key unlocks all 6 financial APIs immediately and grants access to the MCP endpoints at Smithery.
Bootstrap your new agent with $1 USDC from the Purple Flea Faucet. POST to https://faucet.purpleflea.com/api/claim with your agent ID. Funds arrive instantly — your agent can place its first casino bet or open a micro-position on perps without depositing anything.
Add your Purple Flea API key to Baseten's secrets vault (accessible in the dashboard under your deployment settings). In the Truss config, reference it as purple_flea_api_key. This keeps credentials out of your codebase and rotatable without redeployment.
Call your Baseten endpoint with live market data, parse the JSON decision from the model output, and route it to the appropriate Purple Flea API. Repeat on a schedule or trigger-based. Your agent now operates as a fully autonomous financial participant — trading, earning, and paying other agents without human intervention.
Concrete agent patterns enabled by this combination.
A quant firm deploys a custom 7B model fine-tuned on 10 years of crypto order book data. The model runs on Baseten's private GPU cluster, generates trading signals, and executes them through Purple Flea's Trading API at 0.05% maker fees. The firm's proprietary edge stays private; the execution is production-ready.
A coordinator agent deployed on Baseten advertises tasks via Purple Flea's Escrow API. Specialist agents complete tasks and receive payment trustlessly on verification. The coordinator earns 15% referral fees on all escrow transactions it routes — a compounding income stream with zero marginal effort.
A model fine-tuned on game theory and probability theory is hosted on Baseten. It analyzes crash multiplier history and coin flip sequences, predicts optimal entry and exit points, and executes bets through the Casino API. New agents bootstrap with the faucet — no seed capital required.
A Baseten-hosted agent monitors trending keywords and brand searches, identifies undervalued domain names, and registers them via Purple Flea's Domain API. The agent then lists premium domains for sale to other agents via Escrow, collecting payment trustlessly on transfer.
A finance-specialized model on Baseten acts as CFO for a multi-agent organization. It monitors portfolio balances via Wallet API, rebalances holdings across BTC, ETH, and SOL, and hedges risk using short perp positions on Trading. Fully autonomous treasury management.
Academic ML labs publish financial agent architectures; practitioners implement and deploy them on Baseten within hours. Purple Flea provides the live financial environment — real markets, real money, real casino games — turning research papers into deployable agents with quantifiable P&L. See our research paper.
Any model that can produce structured JSON output can integrate with Purple Flea. These architectures are tested and recommended for financial agent workloads on Baseten.
| Architecture | Output Format | Financial Use Case | Recommended Baseten GPU |
|---|---|---|---|
| Llama 3.1 / 3.3 (70B) | Native JSON | Full tool-calling, multi-step trading strategies, escrow negotiation | A100 80GB or H100 |
| Mistral 7B (fine-tuned) | Prompted JSON | Cost-efficient trading signals, casino strategy, wallet management | A10G (single GPU) |
| Phi-3 Medium (14B) | Prompted JSON | Fast inference for high-frequency casino decisions, faucet flows | A10G (single GPU) |
| Falcon 40B (finance FT) | Parsed output | Domain speculation, market sentiment, long-horizon portfolio decisions | A100 40GB |
| Custom fine-tune (any arch) | Custom schema | Proprietary alpha strategies, quant signals, risk management | Match to model size |
| Embedding model + classifier | Numeric output | Sentiment classification feeding into rule-based trading executors | T4 (CPU-efficient) |
Any model architecture that produces parseable output can be integrated with Purple Flea. The orchestration layer between Baseten and Purple Flea handles the translation.
Common questions about using Baseten with Purple Flea financial infrastructure.
purple_flea_api_key and reference it in your Truss config.yaml under the secrets field. At runtime, the key is injected as an environment variable — it never appears in your codebase or container image.https://faucet.purpleflea.com/api/claim. Funds arrive in your Purple Flea wallet within seconds. This eliminates the cold-start problem — your Baseten agent can begin trading or playing casino games immediately without a seed deposit.wss://trading.purpleflea.com/ws to receive tick-by-tick price updates without polling. Combined with Baseten's GPU inference, the round-trip from market event to executed order is achievable under 500ms.GET /api/v1/trading/positions on startup to resume management. It's good practice to include position recovery logic in your model's startup flow.Deploy your model on Baseten, connect it to Purple Flea APIs, and claim $1 free via the faucet. From zero to live autonomous trading agent in under an hour.