ai-tally 0.0.1__tar.gz

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 (218) hide show
  1. ai_tally-0.0.1/.gitignore +56 -0
  2. ai_tally-0.0.1/LICENSE +21 -0
  3. ai_tally-0.0.1/PKG-INFO +600 -0
  4. ai_tally-0.0.1/README.md +566 -0
  5. ai_tally-0.0.1/onboarding_bot/__init__.py +44 -0
  6. ai_tally-0.0.1/onboarding_bot/config.py +109 -0
  7. ai_tally-0.0.1/onboarding_bot/git_ops.py +176 -0
  8. ai_tally-0.0.1/onboarding_bot/github_pr.py +94 -0
  9. ai_tally-0.0.1/onboarding_bot/guards.py +195 -0
  10. ai_tally-0.0.1/onboarding_bot/patch.py +395 -0
  11. ai_tally-0.0.1/onboarding_bot/propose.py +307 -0
  12. ai_tally-0.0.1/onboarding_bot/repo_scan.py +338 -0
  13. ai_tally-0.0.1/onboarding_bot/run.py +479 -0
  14. ai_tally-0.0.1/onboarding_mcp/__init__.py +36 -0
  15. ai_tally-0.0.1/onboarding_mcp/catalog.py +163 -0
  16. ai_tally-0.0.1/onboarding_mcp/coverage_client.py +582 -0
  17. ai_tally-0.0.1/onboarding_mcp/detect.py +528 -0
  18. ai_tally-0.0.1/onboarding_mcp/generate.py +397 -0
  19. ai_tally-0.0.1/onboarding_mcp/sdk_surface.py +253 -0
  20. ai_tally-0.0.1/onboarding_mcp/server.py +152 -0
  21. ai_tally-0.0.1/pyproject.toml +113 -0
  22. ai_tally-0.0.1/recipes/account.node.header_hash.yaml +85 -0
  23. ai_tally-0.0.1/recipes/embedding.generic.call.yaml +27 -0
  24. ai_tally-0.0.1/recipes/index.yaml +58 -0
  25. ai_tally-0.0.1/recipes/llm.generic.call.yaml +47 -0
  26. ai_tally-0.0.1/recipes/middleware.django.account.yaml +32 -0
  27. ai_tally-0.0.1/recipes/middleware.fastapi.account.yaml +32 -0
  28. ai_tally-0.0.1/recipes/middleware.flask.account.yaml +32 -0
  29. ai_tally-0.0.1/recipes/otel.ingest.yaml +36 -0
  30. ai_tally-0.0.1/recipes/otel.node.yaml +61 -0
  31. ai_tally-0.0.1/recipes/proxy.anthropic.base_url.yaml +59 -0
  32. ai_tally-0.0.1/recipes/proxy.openai.base_url.yaml +67 -0
  33. ai_tally-0.0.1/recipes/schema.json +130 -0
  34. ai_tally-0.0.1/recipes/startup.tally.init.yaml +36 -0
  35. ai_tally-0.0.1/recipes/tool.generic.call.yaml +29 -0
  36. ai_tally-0.0.1/recipes/vector.pgvector.query.yaml +28 -0
  37. ai_tally-0.0.1/recipes/vector.pinecone.query.yaml +28 -0
  38. ai_tally-0.0.1/recipes/vector.qdrant.search.yaml +27 -0
  39. ai_tally-0.0.1/recipes/vector.weaviate.query.yaml +27 -0
  40. ai_tally-0.0.1/scripts/check_dist.py +203 -0
  41. ai_tally-0.0.1/scripts/sdk_reference.py +144 -0
  42. ai_tally-0.0.1/scripts/smoke_wheel.sh +67 -0
  43. ai_tally-0.0.1/src/aitally/__init__.py +49 -0
  44. ai_tally-0.0.1/src/aitally/account_identity.py +309 -0
  45. ai_tally-0.0.1/src/aitally/cdp_connectors.py +737 -0
  46. ai_tally-0.0.1/src/aitally/ci_cost.py +450 -0
  47. ai_tally-0.0.1/src/aitally/cli.py +747 -0
  48. ai_tally-0.0.1/src/aitally/client.py +864 -0
  49. ai_tally-0.0.1/src/aitally/compat.py +100 -0
  50. ai_tally-0.0.1/src/aitally/context.py +308 -0
  51. ai_tally-0.0.1/src/aitally/cost_connectors.py +604 -0
  52. ai_tally-0.0.1/src/aitally/egress.py +209 -0
  53. ai_tally-0.0.1/src/aitally/enrichment.py +460 -0
  54. ai_tally-0.0.1/src/aitally/eval_clients.py +411 -0
  55. ai_tally-0.0.1/src/aitally/evals.py +673 -0
  56. ai_tally-0.0.1/src/aitally/extractors/__init__.py +102 -0
  57. ai_tally-0.0.1/src/aitally/extractors/openai.py +115 -0
  58. ai_tally-0.0.1/src/aitally/governor.py +320 -0
  59. ai_tally-0.0.1/src/aitally/guardrails.py +376 -0
  60. ai_tally-0.0.1/src/aitally/hash_account.py +89 -0
  61. ai_tally-0.0.1/src/aitally/hmac_keys.py +416 -0
  62. ai_tally-0.0.1/src/aitally/identity.py +370 -0
  63. ai_tally-0.0.1/src/aitally/init.py +530 -0
  64. ai_tally-0.0.1/src/aitally/instrumentation/__init__.py +82 -0
  65. ai_tally-0.0.1/src/aitally/instrumentation/anthropic.py +191 -0
  66. ai_tally-0.0.1/src/aitally/instrumentation/base.py +616 -0
  67. ai_tally-0.0.1/src/aitally/instrumentation/bedrock.py +166 -0
  68. ai_tally-0.0.1/src/aitally/instrumentation/dedupe.py +260 -0
  69. ai_tally-0.0.1/src/aitally/instrumentation/google_genai.py +133 -0
  70. ai_tally-0.0.1/src/aitally/instrumentation/openai.py +313 -0
  71. ai_tally-0.0.1/src/aitally/instrumentation/patch.py +636 -0
  72. ai_tally-0.0.1/src/aitally/instrumentation/proxy_route.py +142 -0
  73. ai_tally-0.0.1/src/aitally/integrations/__init__.py +7 -0
  74. ai_tally-0.0.1/src/aitally/integrations/litellm.py +1073 -0
  75. ai_tally-0.0.1/src/aitally/judge_rubric.py +120 -0
  76. ai_tally-0.0.1/src/aitally/ledger.py +462 -0
  77. ai_tally-0.0.1/src/aitally/local_capture.py +432 -0
  78. ai_tally-0.0.1/src/aitally/local_eval.py +721 -0
  79. ai_tally-0.0.1/src/aitally/metrics.py +83 -0
  80. ai_tally-0.0.1/src/aitally/models.py +547 -0
  81. ai_tally-0.0.1/src/aitally/object_storage.py +264 -0
  82. ai_tally-0.0.1/src/aitally/overrides.py +432 -0
  83. ai_tally-0.0.1/src/aitally/plan_limits.py +472 -0
  84. ai_tally-0.0.1/src/aitally/price_fetchers/README.md +201 -0
  85. ai_tally-0.0.1/src/aitally/price_fetchers/__init__.py +71 -0
  86. ai_tally-0.0.1/src/aitally/price_fetchers/__main__.py +79 -0
  87. ai_tally-0.0.1/src/aitally/price_fetchers/_base.py +458 -0
  88. ai_tally-0.0.1/src/aitally/price_fetchers/anthropic.py +116 -0
  89. ai_tally-0.0.1/src/aitally/price_fetchers/google.py +369 -0
  90. ai_tally-0.0.1/src/aitally/price_fetchers/job.py +495 -0
  91. ai_tally-0.0.1/src/aitally/price_fetchers/openai.py +117 -0
  92. ai_tally-0.0.1/src/aitally/price_fetchers/providers.py +99 -0
  93. ai_tally-0.0.1/src/aitally/pricing.py +1196 -0
  94. ai_tally-0.0.1/src/aitally/pricing_scraper.py +218 -0
  95. ai_tally-0.0.1/src/aitally/projection.py +423 -0
  96. ai_tally-0.0.1/src/aitally/provisioning.py +465 -0
  97. ai_tally-0.0.1/src/aitally/reconciler.py +403 -0
  98. ai_tally-0.0.1/src/aitally/replay.py +649 -0
  99. ai_tally-0.0.1/src/aitally/replay_capture.py +535 -0
  100. ai_tally-0.0.1/src/aitally/safety.py +115 -0
  101. ai_tally-0.0.1/src/aitally/sampling.py +151 -0
  102. ai_tally-0.0.1/src/aitally/schema.py +497 -0
  103. ai_tally-0.0.1/src/aitally/stitcher.py +331 -0
  104. ai_tally-0.0.1/src/aitally/storage_tiering.py +503 -0
  105. ai_tally-0.0.1/src/aitally/streaming.py +305 -0
  106. ai_tally-0.0.1/src/aitally/stripe_billing.py +691 -0
  107. ai_tally-0.0.1/src/aitally/tail_sampling.py +230 -0
  108. ai_tally-0.0.1/src/aitally/timekeeping.py +95 -0
  109. ai_tally-0.0.1/src/aitally/transport.py +1412 -0
  110. ai_tally-0.0.1/src/aitally/vercel_gateway.py +221 -0
  111. ai_tally-0.0.1/src/aitally/wire.py +314 -0
  112. ai_tally-0.0.1/tests/fixtures/anthropic_models.json +36 -0
  113. ai_tally-0.0.1/tests/fixtures/google_models.json +24 -0
  114. ai_tally-0.0.1/tests/fixtures/openai/chat_completion_cached.json +36 -0
  115. ai_tally-0.0.1/tests/fixtures/openai/chat_completion_plain.json +36 -0
  116. ai_tally-0.0.1/tests/fixtures/openai/chat_completion_tool_calls.json +53 -0
  117. ai_tally-0.0.1/tests/fixtures/openai_models.json +9 -0
  118. ai_tally-0.0.1/tests/fixtures/pricing/anthropic_pricing.md +230 -0
  119. ai_tally-0.0.1/tests/fixtures/pricing/google_pricing.html +1669 -0
  120. ai_tally-0.0.1/tests/fixtures/pricing/openai_pricing.md +220 -0
  121. ai_tally-0.0.1/tests/litellm_mock_provider.py +279 -0
  122. ai_tally-0.0.1/tests/test_account_id.py +345 -0
  123. ai_tally-0.0.1/tests/test_account_identity.py +215 -0
  124. ai_tally-0.0.1/tests/test_anthropic_cache_tokens.py +156 -0
  125. ai_tally-0.0.1/tests/test_auto_manual_dedupe.py +451 -0
  126. ai_tally-0.0.1/tests/test_backfill_mirror.py +109 -0
  127. ai_tally-0.0.1/tests/test_bedrock_provider.py +343 -0
  128. ai_tally-0.0.1/tests/test_billing_mode.py +256 -0
  129. ai_tally-0.0.1/tests/test_cdp_connectors.py +546 -0
  130. ai_tally-0.0.1/tests/test_ci_cost.py +338 -0
  131. ai_tally-0.0.1/tests/test_cli.py +239 -0
  132. ai_tally-0.0.1/tests/test_compat.py +64 -0
  133. ai_tally-0.0.1/tests/test_context.py +124 -0
  134. ai_tally-0.0.1/tests/test_context_drops.py +95 -0
  135. ai_tally-0.0.1/tests/test_control_plane_ddl.py +66 -0
  136. ai_tally-0.0.1/tests/test_cost_connectors.py +439 -0
  137. ai_tally-0.0.1/tests/test_counted_usage.py +106 -0
  138. ai_tally-0.0.1/tests/test_derived_retention_ddl.py +232 -0
  139. ai_tally-0.0.1/tests/test_docs_snippets.py +358 -0
  140. ai_tally-0.0.1/tests/test_egress.py +128 -0
  141. ai_tally-0.0.1/tests/test_endpoint_tls.py +443 -0
  142. ai_tally-0.0.1/tests/test_enrichment.py +391 -0
  143. ai_tally-0.0.1/tests/test_eval_clients.py +345 -0
  144. ai_tally-0.0.1/tests/test_evals.py +354 -0
  145. ai_tally-0.0.1/tests/test_extractors.py +168 -0
  146. ai_tally-0.0.1/tests/test_gemini_provider.py +268 -0
  147. ai_tally-0.0.1/tests/test_governor.py +256 -0
  148. ai_tally-0.0.1/tests/test_guardrails.py +99 -0
  149. ai_tally-0.0.1/tests/test_guardrails_refresh.py +256 -0
  150. ai_tally-0.0.1/tests/test_hmac_bootstrap.py +296 -0
  151. ai_tally-0.0.1/tests/test_hmac_keys.py +170 -0
  152. ai_tally-0.0.1/tests/test_identity.py +275 -0
  153. ai_tally-0.0.1/tests/test_init.py +102 -0
  154. ai_tally-0.0.1/tests/test_instrumentation.py +106 -0
  155. ai_tally-0.0.1/tests/test_integration.py +115 -0
  156. ai_tally-0.0.1/tests/test_integration_identity.py +145 -0
  157. ai_tally-0.0.1/tests/test_judge_rubric.py +100 -0
  158. ai_tally-0.0.1/tests/test_ledger.py +278 -0
  159. ai_tally-0.0.1/tests/test_litellm_logger.py +833 -0
  160. ai_tally-0.0.1/tests/test_litellm_logger_real.py +609 -0
  161. ai_tally-0.0.1/tests/test_local_capture.py +655 -0
  162. ai_tally-0.0.1/tests/test_local_eval.py +586 -0
  163. ai_tally-0.0.1/tests/test_metrics.py +80 -0
  164. ai_tally-0.0.1/tests/test_models.py +259 -0
  165. ai_tally-0.0.1/tests/test_object_storage.py +190 -0
  166. ai_tally-0.0.1/tests/test_onboarding_bot_guards.py +251 -0
  167. ai_tally-0.0.1/tests/test_onboarding_bot_patch.py +235 -0
  168. ai_tally-0.0.1/tests/test_onboarding_bot_propose.py +224 -0
  169. ai_tally-0.0.1/tests/test_onboarding_bot_run.py +354 -0
  170. ai_tally-0.0.1/tests/test_onboarding_mcp.py +401 -0
  171. ai_tally-0.0.1/tests/test_onboarding_mcp_coverage.py +709 -0
  172. ai_tally-0.0.1/tests/test_onboarding_mcp_server.py +173 -0
  173. ai_tally-0.0.1/tests/test_openai_provider_hosts.py +225 -0
  174. ai_tally-0.0.1/tests/test_otel_spans_ddl.py +106 -0
  175. ai_tally-0.0.1/tests/test_overrides.py +648 -0
  176. ai_tally-0.0.1/tests/test_patch_anthropic.py +304 -0
  177. ai_tally-0.0.1/tests/test_patch_bedrock.py +281 -0
  178. ai_tally-0.0.1/tests/test_patch_google_genai.py +302 -0
  179. ai_tally-0.0.1/tests/test_patch_openai.py +326 -0
  180. ai_tally-0.0.1/tests/test_plan_limits.py +376 -0
  181. ai_tally-0.0.1/tests/test_price_fetchers.py +570 -0
  182. ai_tally-0.0.1/tests/test_price_fetchers_live.py +58 -0
  183. ai_tally-0.0.1/tests/test_pricing.py +439 -0
  184. ai_tally-0.0.1/tests/test_pricing_dated_models.py +105 -0
  185. ai_tally-0.0.1/tests/test_pricing_fireworks.py +134 -0
  186. ai_tally-0.0.1/tests/test_pricing_job.py +565 -0
  187. ai_tally-0.0.1/tests/test_pricing_luna.py +86 -0
  188. ai_tally-0.0.1/tests/test_pricing_scraper.py +116 -0
  189. ai_tally-0.0.1/tests/test_pricing_seeds.py +469 -0
  190. ai_tally-0.0.1/tests/test_projection.py +299 -0
  191. ai_tally-0.0.1/tests/test_provisioning.py +247 -0
  192. ai_tally-0.0.1/tests/test_recipes.py +189 -0
  193. ai_tally-0.0.1/tests/test_recipes_node.py +521 -0
  194. ai_tally-0.0.1/tests/test_reconciler.py +279 -0
  195. ai_tally-0.0.1/tests/test_record_embedding_call.py +111 -0
  196. ai_tally-0.0.1/tests/test_record_tool_call.py +171 -0
  197. ai_tally-0.0.1/tests/test_record_vector_call.py +139 -0
  198. ai_tally-0.0.1/tests/test_replay.py +443 -0
  199. ai_tally-0.0.1/tests/test_replay_capture.py +500 -0
  200. ai_tally-0.0.1/tests/test_safety.py +80 -0
  201. ai_tally-0.0.1/tests/test_sampling.py +81 -0
  202. ai_tally-0.0.1/tests/test_schema.py +102 -0
  203. ai_tally-0.0.1/tests/test_sdk_reference.py +83 -0
  204. ai_tally-0.0.1/tests/test_smoke.py +5 -0
  205. ai_tally-0.0.1/tests/test_span_ids.py +413 -0
  206. ai_tally-0.0.1/tests/test_stitcher.py +263 -0
  207. ai_tally-0.0.1/tests/test_storage_tiering.py +187 -0
  208. ai_tally-0.0.1/tests/test_streaming.py +227 -0
  209. ai_tally-0.0.1/tests/test_stripe_billing.py +351 -0
  210. ai_tally-0.0.1/tests/test_tail_sampling.py +170 -0
  211. ai_tally-0.0.1/tests/test_timekeeping.py +88 -0
  212. ai_tally-0.0.1/tests/test_token_tier.py +64 -0
  213. ai_tally-0.0.1/tests/test_trace_id_synthetic.py +95 -0
  214. ai_tally-0.0.1/tests/test_transport.py +1527 -0
  215. ai_tally-0.0.1/tests/test_vercel_gateway.py +171 -0
  216. ai_tally-0.0.1/tests/test_vertex_vector.py +116 -0
  217. ai_tally-0.0.1/tests/test_views_ddl.py +155 -0
  218. ai_tally-0.0.1/tests/test_wire.py +229 -0
@@ -0,0 +1,56 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ dist/
7
+ build/
8
+ .venv/
9
+ venv/
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .mypy_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ # Env / secrets
17
+ .env
18
+ .env.*
19
+ !.env.example
20
+ *.local
21
+ # The audit sink's AWS credentials file and Kafka password (CTO-757), mounted by compose.
22
+ infra/audit-sink/secrets/
23
+ # The local Google sign-in recipe's client secret, code key and dev certificates (oauth-dev).
24
+ infra/oauth-dev/secrets/
25
+ infra/oauth-dev/ca-private/
26
+
27
+ # OS / editor
28
+ .DS_Store
29
+ .idea/
30
+ .vscode/
31
+
32
+ # uv
33
+ uv.lock
34
+
35
+ # The pen test harness's run output: reports and raw response bodies (docs/specs/pentest-harness.md).
36
+ security/pentest/out/
37
+
38
+ # Claude Code worktrees
39
+ .claude/worktrees/
40
+ .aider.*
41
+ keys.txt
42
+
43
+ # Model auto-discovery cache (CTO-109)
44
+ .tally/
45
+
46
+ # Scratch output from Claude sessions. Never committed: this repo is public (CTO-433 review).
47
+ Claude outputs/
48
+
49
+ # Vitest cache (CTO-434, CTO-436). It normally lands in web/node_modules/.vite, which
50
+ # node_modules/ already covers, but a root-level .vite/ has appeared here in practice. Both
51
+ # branches that hit it guessed at the cause and guessed differently, and neither guess reproduces:
52
+ # running the suite from web/ caches under web/node_modules, and running it from the root with
53
+ # --root web creates nothing here. So the trigger is not known, only that it happens. Ignored
54
+ # regardless, because this repo is public and a build artefact must not be one stray `git add -A`
55
+ # away from being published.
56
+ .vite/
ai_tally-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tallynomics LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.