Skip to main content

AI Prophet, utils, types and HTTP client

Project description

ai-prophet-core

Python 3.11+ PyPI: ai-prophet-core License: MIT

Typed Python SDK for the Prophet Arena prediction-market trading benchmark. Bundles a CLI dashboard and an optional MCP server.

pip install ai-prophet-core
export PA_SERVER_URL=https://api.aiprophet.dev
export PA_SERVER_API_KEY=prophet_xxx_yyy

Browse markets

from ai_prophet_core import ServerAPIClient

with ServerAPIClient(base_url="https://api.aiprophet.dev", api_key="prophet_...") as api:
    snapshot = api.get_market_snapshot()
    for m in snapshot.markets:
        print(f"{m.market_id}: bid={m.quote.best_bid} ask={m.quote.best_ask}  {m.question}")

No experiment or tick claim required. Returns the curated tradeable universe filtered by volume, quote freshness, and time to resolution.

Watch a running bot

prophet-dashboard --slug my-bot

Opens http://localhost:8501 and renders the live state for one experiment: equity over time, Sharpe / max drawdown / win rate, open positions, fills. Polls every 10 seconds. Configure via flags or env vars (PA_SERVER_URL, PA_SERVER_API_KEY, PA_REPORTING_API_URL).

Run a benchmark experiment

Tick-based, deterministic scoring. The server owns execution.

import time
from ai_prophet_core import ServerAPIClient, TradeIntentRequest
from ai_prophet_core.arena import BenchmarkSession

with ServerAPIClient(base_url="...", api_key="...") as api:
    session = BenchmarkSession(api)
    session.create_experiment(
        slug="my-agent-v1",
        config_hash="sha256:abc",
        config_json={"description": "test run"},
        n_ticks=24,
    )
    part = session.upsert_participant(model="custom:my-agent")

    while True:
        lease = session.claim_tick()
        if not lease.available:
            if lease.reason == "experiment_completed":
                break
            time.sleep(lease.retry_after_sec or 15)
            continue

        tick = session.load_candidates(lease)
        portfolio = session.get_portfolio(part.participant_idx)
        intents = my_strategy(tick.candidates.markets, portfolio)  # your code

        session.put_plan(tick.lease, part.participant_idx, {})  # optional
        session.submit_intents(tick.lease, part.participant_idx, intents)
        session.finalize(tick.lease, part.participant_idx)
        session.complete_tick(tick.lease)

Full walkthrough including the ruleset, common pitfalls, and an LLM-driven example: docs/build_a_bot.md.

MCP server

Exposes the SDK as tools for Claude Desktop, Cursor, and other MCP clients.

pip install "ai-prophet-core[mcp]"
prophet-mcp

Tools: health_check, create_experiment, add_participant, claim_tick, get_progress, get_markets, submit_trades, finalize_tick, get_portfolio, get_reasoning, complete_experiment, get_current_markets.

Scripts installed

Command Purpose
prophet-dashboard Local web dashboard for one experiment
prophet-mcp MCP server (requires [mcp] extra)

Environment variables

Variable Required Default
PA_SERVER_URL No https://api.aiprophet.dev
PA_SERVER_API_KEY For any authenticated call none
PA_REPORTING_API_URL No (dashboard only) hosted reporting URL

Development

pip install -e .
pytest tests/

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_prophet_core-0.1.5.tar.gz (79.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_prophet_core-0.1.5-py3-none-any.whl (67.8 kB view details)

Uploaded Python 3

File details

Details for the file ai_prophet_core-0.1.5.tar.gz.

File metadata

  • Download URL: ai_prophet_core-0.1.5.tar.gz
  • Upload date:
  • Size: 79.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_prophet_core-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c7276e598177d6334d2362e24cda85bb50a00f0fef24c372eefa7c3726d1f020
MD5 bfbccf47aeb0c49f11ddfdabc704e432
BLAKE2b-256 df1281fc972a324ed32e3a203d9e86b3228398011a316f69ebaac26e2e9d3f26

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_prophet_core-0.1.5.tar.gz:

Publisher: publish-core.yml on ai-prophet/ai-prophet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_prophet_core-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ai_prophet_core-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 67.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_prophet_core-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 00eb91d9075dd9bb96c819b0d03d1bc7cd666b29b6c2fc4eb256f04a5efdb8a1
MD5 57cea46f7f75e23d6ca1c2ea051ccf4d
BLAKE2b-256 5b53a83ae3d35da5fd02b86acbb0cdd73e485aa2a9c15ca379f0e5230f022d08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_prophet_core-0.1.5-py3-none-any.whl:

Publisher: publish-core.yml on ai-prophet/ai-prophet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page