alpha-engine-lib 0.32.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. alpha_engine_lib/__init__.py +3 -0
  2. alpha_engine_lib/agent_schemas.py +663 -0
  3. alpha_engine_lib/alerts.py +576 -0
  4. alpha_engine_lib/arcticdb.py +340 -0
  5. alpha_engine_lib/collector_results.py +69 -0
  6. alpha_engine_lib/cost.py +665 -0
  7. alpha_engine_lib/dates.py +273 -0
  8. alpha_engine_lib/decision_capture.py +462 -0
  9. alpha_engine_lib/ec2_spot.py +363 -0
  10. alpha_engine_lib/email_sender.py +206 -0
  11. alpha_engine_lib/eval_artifacts.py +361 -0
  12. alpha_engine_lib/logging.py +303 -0
  13. alpha_engine_lib/model_pricing.yaml +73 -0
  14. alpha_engine_lib/pillars.py +756 -0
  15. alpha_engine_lib/pipeline_status/__init__.py +70 -0
  16. alpha_engine_lib/pipeline_status/read.py +541 -0
  17. alpha_engine_lib/pipeline_status/registry.py +368 -0
  18. alpha_engine_lib/pipeline_status/templates.py +120 -0
  19. alpha_engine_lib/preflight.py +444 -0
  20. alpha_engine_lib/rag/__init__.py +39 -0
  21. alpha_engine_lib/rag/db.py +96 -0
  22. alpha_engine_lib/rag/embeddings.py +63 -0
  23. alpha_engine_lib/rag/migrations/0001_content_tsv.sql +39 -0
  24. alpha_engine_lib/rag/rerank.py +377 -0
  25. alpha_engine_lib/rag/retrieval.py +465 -0
  26. alpha_engine_lib/rag/schema.sql +65 -0
  27. alpha_engine_lib/reconcile.py +203 -0
  28. alpha_engine_lib/secrets.py +186 -0
  29. alpha_engine_lib/sources/__init__.py +35 -0
  30. alpha_engine_lib/sources/protocols.py +227 -0
  31. alpha_engine_lib/ssm_log_capture.py +274 -0
  32. alpha_engine_lib/telegram.py +165 -0
  33. alpha_engine_lib/trading_calendar.py +236 -0
  34. alpha_engine_lib/transparency.py +746 -0
  35. alpha_engine_lib/transparency_inventory.yaml +260 -0
  36. alpha_engine_lib/universe.py +83 -0
  37. alpha_engine_lib-0.32.0.dist-info/METADATA +217 -0
  38. alpha_engine_lib-0.32.0.dist-info/RECORD +40 -0
  39. alpha_engine_lib-0.32.0.dist-info/WHEEL +5 -0
  40. alpha_engine_lib-0.32.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,73 @@
1
+ # LLM cost rate card — default pricing shipped with alpha_engine_lib.
2
+ #
3
+ # Loaded by ``alpha_engine_lib.cost.load_default_pricing``. Consumers that
4
+ # need their own operator-managed rate card (e.g. alpha-engine-research)
5
+ # should keep using ``load_pricing(path)`` with an external YAML; this
6
+ # file is the sensible default for new consumers (morning-signal and
7
+ # anything else outside the alpha-engine repos) so they don't have to
8
+ # author a pricing table just to wire cost telemetry.
9
+ #
10
+ # Schema (per card):
11
+ # model_name: Anthropic model identifier (matches ModelMetadata.model_name).
12
+ # effective_from: ISO date when this rate became active (inclusive).
13
+ # input_per_1m: USD per 1,000,000 input tokens.
14
+ # output_per_1m: USD per 1,000,000 output tokens.
15
+ # cache_read_per_1m: USD per 1,000,000 cached-prompt-read tokens (0.10× input).
16
+ # cache_create_per_1m: USD per 1,000,000 5-MIN cache-write tokens (1.25× input).
17
+ # (1-hour cache writes are 2.0× input; not modeled here —
18
+ # the SDK reports cache-write tokens uniformly so we
19
+ # price them at the standard 5-min rate. Add a separate
20
+ # field if 1-hour writes become a material spend share.)
21
+ #
22
+ # **Cards for the same model MUST be sorted ascending by effective_from.**
23
+ # When pricing changes, append a new card with the new effective_from rather
24
+ # than editing an existing one — historical artifacts remain repriceable
25
+ # against the rate that was active at their capture time.
26
+ #
27
+ # Sources:
28
+ # https://platform.claude.com/docs/en/about-claude/pricing (verify periodically)
29
+ #
30
+ # version: 1
31
+ cards:
32
+ - model_name: claude-haiku-4-5
33
+ effective_from: 2026-01-01
34
+ input_per_1m: 1.00
35
+ output_per_1m: 5.00
36
+ cache_read_per_1m: 0.10
37
+ cache_create_per_1m: 1.25
38
+ - model_name: claude-sonnet-4-6
39
+ effective_from: 2026-01-01
40
+ input_per_1m: 3.00
41
+ output_per_1m: 15.00
42
+ cache_read_per_1m: 0.30
43
+ cache_create_per_1m: 3.75
44
+ - model_name: claude-opus-4-7
45
+ effective_from: 2026-01-01
46
+ input_per_1m: 5.00
47
+ output_per_1m: 25.00
48
+ cache_read_per_1m: 0.50
49
+ cache_create_per_1m: 6.25
50
+
51
+ # Server-side tool fees (Anthropic ``Message.usage.server_tool_use``).
52
+ # Billed as flat per-request fees, independent of which model invoked
53
+ # the tool. Rates published by Anthropic as USD per 1,000 requests.
54
+ #
55
+ # Schema (per fee):
56
+ # tool_name: Server-tool identifier (matches the field name
57
+ # in ``anthropic.types.ServerToolUsage``).
58
+ # effective_from: ISO date when this rate became active.
59
+ # per_1k_requests_usd: USD per 1,000 requests.
60
+ #
61
+ # **Fees for the same tool MUST be sorted ascending by effective_from.**
62
+ #
63
+ # web_fetch is currently free per Anthropic's pricing page (no separate
64
+ # per-request fee) — kept in the table at 0.00 so request counts still
65
+ # flow through the pricing pipeline; bump the rate here if/when Anthropic
66
+ # introduces a fee.
67
+ tool_fees:
68
+ - tool_name: web_search
69
+ effective_from: 2026-01-01
70
+ per_1k_requests_usd: 10.00
71
+ - tool_name: web_fetch
72
+ effective_from: 2026-01-01
73
+ per_1k_requests_usd: 0.00