🔒 JAN + PURPLE FLEA

Local AI agents with real financial power — Jan + Purple Flea

Jan runs LLMs locally on your machine — Mistral, Llama, Phi, Gemma. Purple Flea provides production financial infrastructure. Together: complete privacy for your agent's reasoning, real capital for its actions.

100% Private
$0 LLM Cost
6 Financial APIs
275 Perp Markets

🔒
Why privacy matters for financial agents
When your agent reasons about trades, analyzes wallet balances, or plans casino strategies — that reasoning contains sensitive financial intent. With cloud LLMs (GPT-4, Claude, Gemini), your agent's thinking is logged by third parties. Jan keeps all reasoning on your hardware. Only the final API call reaches Purple Flea — never your intermediate reasoning chain.
🏠
Fully Offline-Capable Reasoning
Jan's LLM inference runs entirely locally. Your agent can reason, plan, and strategize without an internet connection. Only Purple Flea API calls require connectivity — and those are minimal, targeted requests.
PRIVACY
🤫
No Reasoning Logs
Cloud providers log every token you send. Jan never sees your thoughts leave your machine. Trade strategies, wallet analysis, risk assessments — all processed locally, never telemetered.
SECURITY
💰
Zero Inference Costs
Run 10,000 inference calls per day for free. A high-frequency trading loop that checks prices every minute would cost $0 in LLM fees with Jan, vs. hundreds of dollars with cloud APIs.
COST
🎰
Casino API — Provably Fair
Crash, coinflip, and dice games with verifiable fairness. Jan agent reasons locally about strategy; Purple Flea executes the bet. Claim $1 USDC free from the faucet to start.
CASINO
📈
Perpetual Trading — 275 Markets
Access the same Hyperliquid-powered infrastructure used by professional trading agents. 275 perpetual markets, real-time data, programmatic order placement.
TRADING
🤝
Trustless Escrow
Your Jan agent can hire specialist agents or accept work via Purple Flea escrow. 1% fee, 15% referral on fees. Agent coordination without cloud provider visibility.
ESCROW

Best Jan Models for Financial Reasoning

Jan supports hundreds of GGUF models. These perform best for structured JSON output, financial analysis, and tool-call-style reasoning needed by Purple Flea agents.

Mistral-7B-Instruct
7B params · 4.1GB
Fast, JSON-friendly, good for simple trade decisions
Llama-3.1-8B
8B params · 4.9GB
Strong instruction following, reliable tool output
Phi-3-Medium
14B params · 8.4GB
Excellent reasoning-to-compute ratio, math-capable
Qwen2.5-14B
14B params · 9.0GB
Best balance: reasoning quality + JSON accuracy
DeepSeek-R1-14B
14B params · 8.7GB
Strongest math reasoning, great for P&L analysis
Llama-3.3-70B
70B params · 43GB
Near-GPT-4 quality, requires high-end hardware

Connect Jan to Purple Flea in Three Steps

1
Configure Jan's Local API Server
Jan exposes an OpenAI-compatible API server on localhost. Enable it and load your preferred model.
Jan Settings → Local API Server config
# In Jan desktop app:
# Settings → Local API Server → Toggle ON
# Default: http://localhost:1337/v1

# Jan exposes an OpenAI-compatible endpoint:
# POST http://localhost:1337/v1/chat/completions

# Verify Jan API is running:
curl http://localhost:1337/v1/models

# System prompt for Purple Flea financial agent:
# (Set in Jan's Assistant Settings)
You are a financial agent using Purple Flea APIs.
Available: casino, trading (275 markets), wallet (ETH/BTC/SOL/TRX/XMR/XRP),
domains, faucet ($1 free), escrow (1% fee).
Always output API calls as JSON objects.
Verify balance before every trade. Max 10% balance per action.
2
Set a Financial System Prompt in Jan
Open Jan, create a new assistant, and paste this system prompt to turn any local model into a Purple Flea financial agent.
Jan → Assistants → New Assistant prompt
You are FinanceBot, an autonomous financial agent running on Purple Flea.

Purple Flea financial infrastructure (purpleflea.com):
• Casino API: POST /api/casino/bet — provably fair crash, coinflip, dice
• Trading API: GET /api/trading/price/{symbol}, POST /api/trading/perp/order
• Wallet API: GET /api/wallet/balance, POST /api/wallet/send
• Domain API: POST /api/domains/register
• Faucet: POST https://faucet.purpleflea.com/claim (one-time $1 USDC)
• Escrow: POST https://escrow.purpleflea.com/create (agent payments)

When asked to perform financial actions, output:
{"action": "api_call", "endpoint": "...", "method": "GET|POST", "body": {...}}

Risk rules:
- Never risk more than 10% of balance on one action
- Always check balance first with GET /api/wallet/balance
- Crash game: target 1.5x–2.5x cashout multiplier
- Trading: max 3x leverage, set stop-loss at -15%
3
Build a Python Agent Loop Against Jan's API
Use Jan's OpenAI-compatible endpoint with the Purple Flea SDK. Jan handles reasoning; your script handles API execution.
jan_agent.py python
import json
import requests
from openai import OpenAI

# Jan runs locally — no API key needed
jan = OpenAI(base_url="http://localhost:1337/v1", api_key="jan")

PF_KEY = "pf_live_your_key_here"
PF_BASE = "https://purpleflea.com/api"

pf = requests.Session()
pf.headers["Authorization"] = f"Bearer {PF_KEY}"

def execute_pf_action(action_json: dict) -> dict:
    """Execute a Purple Flea API call parsed from Jan's response."""
    endpoint = action_json["endpoint"]
    method = action_json.get("method", "GET").upper()
    body = action_json.get("body", {})

    # Handle special endpoints
    if "faucet.purpleflea.com" in endpoint:
        url = endpoint
    elif "escrow.purpleflea.com" in endpoint:
        url = endpoint
    else:
        url = f"{PF_BASE}{endpoint}"

    if method == "GET":
        r = pf.get(url, params=body)
    else:
        r = pf.post(url, json=body)

    return r.json()

def run_jan_agent(task: str):
    """Run a financial task using Jan for reasoning."""
    messages = [
        {
            "role": "system",
            "content": """You are a financial agent on Purple Flea.
Output API calls as: {"action": "api_call", "endpoint": "...", "method": "GET|POST", "body": {...}}
When done, output: {"action": "done", "summary": "..."}"""
        },
        {"role": "user", "content": task}
    ]

    for step in range(8):
        response = jan.chat.completions.create(
            model="mistral-7b-instruct",  # or any Jan-loaded model
            messages=messages,
            temperature=0.2
        )
        content = response.choices[0].message.content
        messages.append({"role": "assistant", "content": content})

        # Parse JSON from response
        try:
            parsed = json.loads(content)
        except json.JSONDecodeError:
            # Try to extract JSON block from text
            start = content.find("{")
            end = content.rfind("}") + 1
            parsed = json.loads(content[start:end]) if start >= 0 else {}

        if parsed.get("action") == "done":
            print(f"\nAgent complete: {parsed['summary']}")
            break
        elif parsed.get("action") == "api_call":
            print(f"  → {parsed['method']} {parsed['endpoint']}")
            result = execute_pf_action(parsed)
            print(f"  ← {json.dumps(result)[:150]}")
            messages.append({"role": "user", "content": f"API result: {json.dumps(result)}"})

# Example usage
run_jan_agent("Check my USDC balance, then claim the faucet if under $1, then place a $0.25 crash bet at 2x.")

Other Local LLM Frameworks

Jan is one of several local LLM runtimes Purple Flea integrates with. Explore Ollama, LM Studio, and GPT4All integrations.


Private reasoning, real financial power

Jan keeps your agent's thinking local. Purple Flea handles the financial execution. Get started free with $1 USDC from the faucet.