agentcogs 0.1.1__tar.gz → 0.1.3__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 (25) hide show
  1. agentcogs-0.1.3/PKG-INFO +115 -0
  2. agentcogs-0.1.3/PYPI.md +84 -0
  3. {agentcogs-0.1.1 → agentcogs-0.1.3}/pyproject.toml +5 -6
  4. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/__init__.py +1 -1
  5. agentcogs-0.1.3/src/agentcogs/_version.py +1 -0
  6. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/config.py +2 -2
  7. agentcogs-0.1.1/PKG-INFO +0 -149
  8. agentcogs-0.1.1/README.md +0 -117
  9. agentcogs-0.1.1/src/agentcogs/_version.py +0 -1
  10. {agentcogs-0.1.1 → agentcogs-0.1.3}/.gitignore +0 -0
  11. {agentcogs-0.1.1 → agentcogs-0.1.3}/LICENSE +0 -0
  12. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/__main__.py +0 -0
  13. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/_shekel_compat.py +0 -0
  14. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/budget.py +0 -0
  15. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/client.py +0 -0
  16. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/context.py +0 -0
  17. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/errors.py +0 -0
  18. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/integrations/__init__.py +0 -0
  19. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/integrations/fastapi.py +0 -0
  20. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/integrations/langgraph.py +0 -0
  21. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/integrations/litellm_event.py +0 -0
  22. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/outbox.py +0 -0
  23. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/ping.py +0 -0
  24. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/shutdown.py +0 -0
  25. {agentcogs-0.1.1 → agentcogs-0.1.3}/src/agentcogs/tokens.py +0 -0
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.5
2
+ Name: agentcogs
3
+ Version: 0.1.3
4
+ Summary: Customer-level AI unit economics. Compare each customer's LLM cost with their monthly fee
5
+ Project-URL: Homepage, https://agentcogs.vercel.app
6
+ Project-URL: Repository, https://github.com/vaibhav11123/agentcogs
7
+ Project-URL: Issues, https://github.com/vaibhav11123/agentcogs/issues
8
+ Author-email: AgentCOGS <hello@agentcogs.dev>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: anthropic,attribution,billing,cost,langchain,langgraph,llm,margin,openai,tenant,unit-economics
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: httpx>=0.27.0
21
+ Requires-Dist: shekel[anthropic,openai]<2,>=1.2
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
24
+ Requires-Dist: pytest>=8.0; extra == 'dev'
25
+ Requires-Dist: respx>=0.20; extra == 'dev'
26
+ Requires-Dist: ruff>=0.6; extra == 'dev'
27
+ Requires-Dist: starlette>=0.27.0; extra == 'dev'
28
+ Provides-Extra: integrations
29
+ Requires-Dist: starlette>=0.27.0; extra == 'integrations'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # AgentCOGS
33
+
34
+ AgentCOGS is an open-source Python SDK and a self-hosted dashboard for customer-level AI unit economics. It attributes each LLM call to the customer who caused it, compares that cost with the monthly fee, and checks a per-customer budget before the next SDK call.
35
+
36
+ **Know which AI customers make you money, and which ones are eating your margins.** The blended total can look fine while one fee no longer covers the AI cost. Which customer stops making money this month.
37
+
38
+ ```bash
39
+ pip install agentcogs
40
+ ```
41
+
42
+ This package is the SDK. It is on PyPI. The customer list is the dashboard in the [repository](https://github.com/vaibhav11123/agentcogs), and you run that yourself. A hosted API is not serving. The working sample is [agentcogs.vercel.app](https://agentcogs.vercel.app).
43
+
44
+ ## What does the number mean?
45
+
46
+ AI margin is `(monthly fee − attributed AI cost) / monthly fee`. It is the contribution of the fee after attributed AI cost. It is not total customer profitability, and it is not accounting gross margin. People, infrastructure, support, payment processing, refunds, discounts, credits, and proration are outside it. Pace is a straight line from the cost so far. It does not forecast a change in behavior. You type the fee, or you pull that customer's Stripe subscription. The SDK does not invent it.
47
+
48
+ ## Install, configure, instrument, verify
49
+
50
+ `AGENTCOGS_ENDPOINT` defaults to `http://localhost:8000`. Create a workspace with the self-hosted dashboard, then:
51
+
52
+ ```python
53
+ import os
54
+ from openai import OpenAI
55
+ import agentcogs
56
+
57
+ agentcogs.init() # AGENTCOGS_API_KEY, AGENTCOGS_WORKSPACE_ID, AGENTCOGS_ENDPOINT
58
+ print(agentcogs.ping())
59
+ agentcogs.set_customer("acme") # your tenant id, once per request
60
+
61
+ with agentcogs.run(workflow_id="support") as ctx:
62
+ if os.environ.get("OPENAI_API_KEY"):
63
+ OpenAI().chat.completions.create(
64
+ model="gpt-4o-mini",
65
+ messages=[{"role": "user", "content": "Say hi in one word."}],
66
+ max_tokens=5,
67
+ )
68
+
69
+ print(ctx.wait_for_ingest().accepted, ctx.run_id)
70
+ ```
71
+
72
+ The SDK does not call a model. Inside the block, shekel reads token usage from the OpenAI or Anthropic call you make. When the block exits, that cost is posted. With no `OPENAI_API_KEY`, the same block posts a zero-cost run so you can see the row. Open that customer and type the monthly fee.
73
+
74
+ `python examples/hello_agentcogs.py` in the repository is this path. `python examples/one_run.py` posts one recorded cost of USD 0.84 and does not call a model.
75
+
76
+ ## How attribution works
77
+
78
+ `set_customer()` names the tenant for this request. `run()` watches the instrumented client calls in the block and posts one event with `total_usd` when the block exits. If no customer is set, `run()` raises before the block. A duplicate `run_id` is accepted as a duplicate and is not stored twice. A failed post sits in a local outbox and is retried. `python -m agentcogs outbox status` shows what has not been delivered.
79
+
80
+ ## What the budget check does
81
+
82
+ If `monthly_budget_usd` is already exceeded, the next `run()` raises `CustomerBudgetExceededError` and does not enter the block. Two calls already in flight can both pass. It is not an atomic reservation. A LiteLLM callback records cost after the provider has already answered, so it cannot stop that call.
83
+
84
+ LiteLLM does not ship the callback. You copy it from the repository. The FastAPI middleware is a separate extra: `pip install "agentcogs[integrations]"`.
85
+
86
+ ## Supported integrations
87
+
88
+ | | |
89
+ | --- | --- |
90
+ | OpenAI and Anthropic | Usage read inside `run()` by shekel, which this package depends on |
91
+ | [FastAPI](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/fastapi.md) | Set the tenant from the request. Needs the `integrations` extra |
92
+ | [LangGraph](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/langgraph.md) | Wrap the graph |
93
+ | [LiteLLM](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/litellm.md) | A callback you register. It posts after the proxy call |
94
+ | Stripe | The subscription is the fee. An optional meter pushes usage you already attributed |
95
+ | [Slack](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/slack.md) | A spike opens that customer |
96
+
97
+ ## One fictional account
98
+
99
+ [Patternstack](https://agentcogs.vercel.app) is a snapshot of forty fictional customers, as of 14 Nov 2026. The blended AI margin is 74.6%. Vellum Research has spent USD 5,822.84 against a fee of USD 8,200, so it is 29.0% so far, and the straight-line pace ends near −52.2%. The sample does not receive your calls.
100
+
101
+ <img src="https://raw.githubusercontent.com/vaibhav11123/agentcogs/main/docs/assets/patternstack.gif" alt="Opening the fictional Patternstack sample. AI margin is 74.6%. Vellum Research is 29.0% so far and the month ends near −52.2%." width="840">
102
+
103
+ ## Documentation
104
+
105
+ - [Quickstart](https://github.com/vaibhav11123/agentcogs/blob/main/docs/quickstart.md)
106
+ - [Self-host](https://github.com/vaibhav11123/agentcogs/blob/main/docs/DEPLOY.md)
107
+ - [Customer id](https://github.com/vaibhav11123/agentcogs/blob/main/docs/concepts/customer-id.md)
108
+ - [Docs index](https://github.com/vaibhav11123/agentcogs/blob/main/docs/README.md)
109
+ - [Repository README](https://github.com/vaibhav11123/agentcogs/blob/main/README.md)
110
+ - Sample: https://agentcogs.vercel.app
111
+ - Source: https://github.com/vaibhav11123/agentcogs
112
+
113
+ ## What is not guaranteed
114
+
115
+ A match against the provider invoice, refunds, credits, discounts, currency conversion, and a hard stop when two calls pass the pre-check together. Development status is Beta: the SDK surface is `init`, `set_customer`, `run`, `ping`, and `shutdown`, and a hosted API is not part of this release.
@@ -0,0 +1,84 @@
1
+ # AgentCOGS
2
+
3
+ AgentCOGS is an open-source Python SDK and a self-hosted dashboard for customer-level AI unit economics. It attributes each LLM call to the customer who caused it, compares that cost with the monthly fee, and checks a per-customer budget before the next SDK call.
4
+
5
+ **Know which AI customers make you money, and which ones are eating your margins.** The blended total can look fine while one fee no longer covers the AI cost. Which customer stops making money this month.
6
+
7
+ ```bash
8
+ pip install agentcogs
9
+ ```
10
+
11
+ This package is the SDK. It is on PyPI. The customer list is the dashboard in the [repository](https://github.com/vaibhav11123/agentcogs), and you run that yourself. A hosted API is not serving. The working sample is [agentcogs.vercel.app](https://agentcogs.vercel.app).
12
+
13
+ ## What does the number mean?
14
+
15
+ AI margin is `(monthly fee − attributed AI cost) / monthly fee`. It is the contribution of the fee after attributed AI cost. It is not total customer profitability, and it is not accounting gross margin. People, infrastructure, support, payment processing, refunds, discounts, credits, and proration are outside it. Pace is a straight line from the cost so far. It does not forecast a change in behavior. You type the fee, or you pull that customer's Stripe subscription. The SDK does not invent it.
16
+
17
+ ## Install, configure, instrument, verify
18
+
19
+ `AGENTCOGS_ENDPOINT` defaults to `http://localhost:8000`. Create a workspace with the self-hosted dashboard, then:
20
+
21
+ ```python
22
+ import os
23
+ from openai import OpenAI
24
+ import agentcogs
25
+
26
+ agentcogs.init() # AGENTCOGS_API_KEY, AGENTCOGS_WORKSPACE_ID, AGENTCOGS_ENDPOINT
27
+ print(agentcogs.ping())
28
+ agentcogs.set_customer("acme") # your tenant id, once per request
29
+
30
+ with agentcogs.run(workflow_id="support") as ctx:
31
+ if os.environ.get("OPENAI_API_KEY"):
32
+ OpenAI().chat.completions.create(
33
+ model="gpt-4o-mini",
34
+ messages=[{"role": "user", "content": "Say hi in one word."}],
35
+ max_tokens=5,
36
+ )
37
+
38
+ print(ctx.wait_for_ingest().accepted, ctx.run_id)
39
+ ```
40
+
41
+ The SDK does not call a model. Inside the block, shekel reads token usage from the OpenAI or Anthropic call you make. When the block exits, that cost is posted. With no `OPENAI_API_KEY`, the same block posts a zero-cost run so you can see the row. Open that customer and type the monthly fee.
42
+
43
+ `python examples/hello_agentcogs.py` in the repository is this path. `python examples/one_run.py` posts one recorded cost of USD 0.84 and does not call a model.
44
+
45
+ ## How attribution works
46
+
47
+ `set_customer()` names the tenant for this request. `run()` watches the instrumented client calls in the block and posts one event with `total_usd` when the block exits. If no customer is set, `run()` raises before the block. A duplicate `run_id` is accepted as a duplicate and is not stored twice. A failed post sits in a local outbox and is retried. `python -m agentcogs outbox status` shows what has not been delivered.
48
+
49
+ ## What the budget check does
50
+
51
+ If `monthly_budget_usd` is already exceeded, the next `run()` raises `CustomerBudgetExceededError` and does not enter the block. Two calls already in flight can both pass. It is not an atomic reservation. A LiteLLM callback records cost after the provider has already answered, so it cannot stop that call.
52
+
53
+ LiteLLM does not ship the callback. You copy it from the repository. The FastAPI middleware is a separate extra: `pip install "agentcogs[integrations]"`.
54
+
55
+ ## Supported integrations
56
+
57
+ | | |
58
+ | --- | --- |
59
+ | OpenAI and Anthropic | Usage read inside `run()` by shekel, which this package depends on |
60
+ | [FastAPI](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/fastapi.md) | Set the tenant from the request. Needs the `integrations` extra |
61
+ | [LangGraph](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/langgraph.md) | Wrap the graph |
62
+ | [LiteLLM](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/litellm.md) | A callback you register. It posts after the proxy call |
63
+ | Stripe | The subscription is the fee. An optional meter pushes usage you already attributed |
64
+ | [Slack](https://github.com/vaibhav11123/agentcogs/blob/main/docs/integrations/slack.md) | A spike opens that customer |
65
+
66
+ ## One fictional account
67
+
68
+ [Patternstack](https://agentcogs.vercel.app) is a snapshot of forty fictional customers, as of 14 Nov 2026. The blended AI margin is 74.6%. Vellum Research has spent USD 5,822.84 against a fee of USD 8,200, so it is 29.0% so far, and the straight-line pace ends near −52.2%. The sample does not receive your calls.
69
+
70
+ <img src="https://raw.githubusercontent.com/vaibhav11123/agentcogs/main/docs/assets/patternstack.gif" alt="Opening the fictional Patternstack sample. AI margin is 74.6%. Vellum Research is 29.0% so far and the month ends near −52.2%." width="840">
71
+
72
+ ## Documentation
73
+
74
+ - [Quickstart](https://github.com/vaibhav11123/agentcogs/blob/main/docs/quickstart.md)
75
+ - [Self-host](https://github.com/vaibhav11123/agentcogs/blob/main/docs/DEPLOY.md)
76
+ - [Customer id](https://github.com/vaibhav11123/agentcogs/blob/main/docs/concepts/customer-id.md)
77
+ - [Docs index](https://github.com/vaibhav11123/agentcogs/blob/main/docs/README.md)
78
+ - [Repository README](https://github.com/vaibhav11123/agentcogs/blob/main/README.md)
79
+ - Sample: https://agentcogs.vercel.app
80
+ - Source: https://github.com/vaibhav11123/agentcogs
81
+
82
+ ## What is not guaranteed
83
+
84
+ A match against the provider invoice, refunds, credits, discounts, currency conversion, and a hard stop when two calls pass the pre-check together. Development status is Beta: the SDK surface is `init`, `set_customer`, `run`, `ping`, and `shutdown`, and a hosted API is not part of this release.
@@ -5,12 +5,12 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "agentcogs"
7
7
  dynamic = ["version"]
8
- description = "Per-customer LLM cost attribution and runtime budget caps for agent SaaS"
9
- readme = "README.md"
8
+ description = "Customer-level AI unit economics. Compare each customer's LLM cost with their monthly fee"
9
+ readme = "PYPI.md"
10
10
  license = { text = "MIT" }
11
11
  requires-python = ">=3.10"
12
12
  authors = [{ name = "AgentCOGS", email = "hello@agentcogs.dev" }]
13
- keywords = ["llm", "cost", "attribution", "langgraph", "langchain", "openai", "anthropic", "billing"]
13
+ keywords = ["llm", "cost", "attribution", "margin", "unit-economics", "tenant", "langgraph", "langchain", "openai", "anthropic", "billing"]
14
14
  classifiers = [
15
15
  "Development Status :: 4 - Beta",
16
16
  "Intended Audience :: Developers",
@@ -23,7 +23,6 @@ classifiers = [
23
23
  dependencies = [
24
24
  "shekel[openai,anthropic]>=1.2,<2",
25
25
  "httpx>=0.27.0",
26
- "starlette>=0.27.0",
27
26
  ]
28
27
 
29
28
  [project.optional-dependencies]
@@ -31,7 +30,7 @@ dev = ["pytest>=8.0", "pytest-asyncio>=0.23", "respx>=0.20", "ruff>=0.6", "starl
31
30
  integrations = ["starlette>=0.27.0"]
32
31
 
33
32
  [project.urls]
34
- Homepage = "https://agentcogs.dev"
33
+ Homepage = "https://agentcogs.vercel.app"
35
34
  Repository = "https://github.com/vaibhav11123/agentcogs"
36
35
  Issues = "https://github.com/vaibhav11123/agentcogs/issues"
37
36
 
@@ -44,7 +43,7 @@ packages = ["src/agentcogs"]
44
43
  # pip install prefers the wheel. The sdist is the fallback and must stay the
45
44
  # SDK. The backend, dashboard, and demo tools are the rest of this repo.
46
45
  [tool.hatch.build.targets.sdist]
47
- only-include = ["src/agentcogs", "README.md", "LICENSE"]
46
+ only-include = ["src/agentcogs", "PYPI.md", "LICENSE"]
48
47
 
49
48
  [tool.ruff]
50
49
  line-length = 100
@@ -2,7 +2,7 @@
2
2
 
3
3
  Quickstart:
4
4
  import agentcogs
5
- agentcogs.init(api_key="acg_live_...", workspace_id="...")
5
+ agentcogs.init() # AGENTCOGS_API_KEY, AGENTCOGS_WORKSPACE_ID, AGENTCOGS_ENDPOINT
6
6
 
7
7
  agentcogs.set_customer("tenant_42") # once per request
8
8
  with agentcogs.run(workflow_id="summarize"):
@@ -0,0 +1 @@
1
+ __version__ = "0.1.3"
@@ -12,7 +12,7 @@ BudgetMode = Literal["open", "closed"]
12
12
  class _Config:
13
13
  api_key: Optional[str] = None
14
14
  workspace_id: Optional[str] = None
15
- endpoint: str = "https://api.agentcogs.dev"
15
+ endpoint: str = "http://localhost:8000"
16
16
  timeout_seconds: float = 2.0
17
17
  offline: bool = False
18
18
  budget_mode: BudgetMode = "open"
@@ -51,7 +51,7 @@ def init(
51
51
  _config.endpoint = (
52
52
  endpoint
53
53
  or os.environ.get("AGENTCOGS_ENDPOINT")
54
- or "https://api.agentcogs.dev"
54
+ or "http://localhost:8000"
55
55
  ).rstrip("/")
56
56
  _config.offline = offline or os.environ.get("AGENTCOGS_OFFLINE") == "1"
57
57
  _config.timeout_seconds = timeout_seconds
agentcogs-0.1.1/PKG-INFO DELETED
@@ -1,149 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: agentcogs
3
- Version: 0.1.1
4
- Summary: Per-customer LLM cost attribution and runtime budget caps for agent SaaS
5
- Project-URL: Homepage, https://agentcogs.dev
6
- Project-URL: Repository, https://github.com/vaibhav11123/agentcogs
7
- Project-URL: Issues, https://github.com/vaibhav11123/agentcogs/issues
8
- Author-email: AgentCOGS <hello@agentcogs.dev>
9
- License: MIT
10
- License-File: LICENSE
11
- Keywords: anthropic,attribution,billing,cost,langchain,langgraph,llm,openai
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Software Development :: Libraries
19
- Requires-Python: >=3.10
20
- Requires-Dist: httpx>=0.27.0
21
- Requires-Dist: shekel[anthropic,openai]<2,>=1.2
22
- Requires-Dist: starlette>=0.27.0
23
- Provides-Extra: dev
24
- Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
25
- Requires-Dist: pytest>=8.0; extra == 'dev'
26
- Requires-Dist: respx>=0.20; extra == 'dev'
27
- Requires-Dist: ruff>=0.6; extra == 'dev'
28
- Requires-Dist: starlette>=0.27.0; extra == 'dev'
29
- Provides-Extra: integrations
30
- Requires-Dist: starlette>=0.27.0; extra == 'integrations'
31
- Description-Content-Type: text/markdown
32
-
33
- # AgentCOGS
34
-
35
- **Which customer stops making money this month.**
36
-
37
- You sell an agent to other companies. The model provider sends one invoice. AgentCOGS splits that spend by the tenant who caused it, sets it against the monthly fee, and shows where the month is headed if the calls keep coming.
38
-
39
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
40
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
41
- [![CI](https://github.com/vaibhav11123/agentcogs/actions/workflows/ci.yml/badge.svg)](https://github.com/vaibhav11123/agentcogs/actions/workflows/ci.yml)
42
-
43
- The sample company is [Patternstack](https://agentcogs.vercel.app). One click, nothing to type. It is a snapshot of a fictional book of business, shipped in the dashboard, so it opens when no API is running. A hosted AgentCOGS API is not serving. To run your own customers, self-host.
44
-
45
- ---
46
-
47
- ## The book, and the account inside it
48
-
49
- Patternstack, as of 14 Nov 2026. Forty customers. The month so far looks healthy.
50
-
51
- | | So far | If the calls continue |
52
- | --- | ---: | ---: |
53
- | AI cost | $39,613.25 | $84,885.54 |
54
- | Fees | $155,918.00 | $155,918.00 |
55
- | Margin | 74.6% | 45.6% |
56
-
57
- The fee is the monthly amount on the account. Pace is a straight line from the cost so far. It does not forecast a change in behavior.
58
-
59
- Two accounts are where the month breaks. Vellum Research has cost $5,822.84 against an $8,200 fee: **29.0%** so far, 2,724 runs, and the largest node is `synthesize`. If that spend continues, the month ends near **−52.2%**. Pinnacle Claims is 35.0% so far and ends near −39.3%. The blended 74.6% does not show either of those.
60
-
61
- <p align="center">
62
- <img src="docs/assets/screenshots/patternstack-customers.png" alt="Patternstack customers. Blended margin 74.6%. Vellum Research is 29.0% and the month ends near −52.2%." width="880" />
63
- </p>
64
-
65
- Open the account and the same numbers sit next to the call that posted them.
66
-
67
- <p align="center">
68
- <img src="docs/assets/screenshots/vellum-research.png" alt="Vellum Research. Margin 29.0%, AI cost $5,822.84, fee $8,200, and the set_customer call that posts each run." width="880" />
69
- </p>
70
-
71
- ```python
72
- import agentcogs
73
-
74
- agentcogs.init() # AGENTCOGS_API_KEY, AGENTCOGS_WORKSPACE_ID, AGENTCOGS_ENDPOINT
75
- agentcogs.set_customer("vellum_research") # your tenant id, once per request
76
-
77
- with agentcogs.run(workflow_id="research_agent"):
78
- result = agent.invoke(state)
79
- ```
80
-
81
- The SDK does not call a model and does not invent the fee. It names the customer and posts the cost of the call you already made. You type the fee, or you pull the subscription from that customer's Stripe account. If no customer is set, the run stays unattributed.
82
-
83
- `python examples/one_run.py` posts one recorded $0.84 cost for Vellum Research so you can see a row land. It does not call a model.
84
-
85
- ---
86
-
87
- ## Look, then run it on yours
88
-
89
- **Look.** [agentcogs.vercel.app](https://agentcogs.vercel.app) → **Open Patternstack**.
90
-
91
- **Run.** From this repo:
92
-
93
- ```bash
94
- cp .env.selfhost.example .env
95
- docker compose up -d --build
96
- ```
97
-
98
- Open http://localhost:3000 and choose **Create my workspace**. No email. The next screen has the install command with your key in it. The package is not on PyPI yet:
99
-
100
- ```bash
101
- pip install "agentcogs @ git+https://github.com/vaibhav11123/agentcogs.git"
102
- ```
103
-
104
- Point `AGENTCOGS_ENDPOINT` at `http://localhost:8000`. Send one call, open that customer, and type the monthly fee. Margin is the fee minus the cost.
105
-
106
- Full steps: [docs/quickstart.md](docs/quickstart.md). Self-host notes: [docs/DEPLOY.md](docs/DEPLOY.md).
107
-
108
- ---
109
-
110
- ## Who it is for
111
-
112
- A founder of a product that sells one agent to many companies, priced as a monthly fee, with the model bill arriving as a single invoice. Support, research, claims, intake, document pipelines.
113
-
114
- | You already have | AgentCOGS adds |
115
- | --- | --- |
116
- | Langfuse or LangSmith | Which tenant the trace belonged to, and whether that tenant is still profitable |
117
- | LiteLLM | A callback that posts the tenant and the cost. The proxy stays |
118
- | Stripe | The subscription as the fee, and an optional meter for the usage you already attributed |
119
- | The provider invoice | The join from that one number to the customer list |
120
-
121
- ---
122
-
123
- ## What you can connect
124
-
125
- | | |
126
- | --- | --- |
127
- | [FastAPI](docs/integrations/fastapi.md) | Set the tenant from the request |
128
- | [LangGraph](docs/integrations/langgraph.md) | Wrap the graph |
129
- | [LiteLLM](docs/integrations/litellm.md) | Post proxy traffic without wrapping the app |
130
- | [Customer import](docs/integrations/customer-import.md) | Load names and fees before the first run |
131
- | [Slack](docs/integrations/slack.md) | A spike opens that customer |
132
- | Stripe | Pull subscription fees. Push a daily usage meter |
133
- | Budget | `monthly_budget_usd` raises `CustomerBudgetExceededError` before the next call |
134
-
135
- Terminal proof for the SDK, the outbox, and a live call: [docs/demo-paths.md](docs/demo-paths.md).
136
-
137
- ---
138
-
139
- ## Repo
140
-
141
- | Path | |
142
- | --- | --- |
143
- | `src/agentcogs/` | The SDK |
144
- | `backend/` | Ingest, margin, pace, budgets |
145
- | `dashboard/` | The book |
146
- | `examples/one_run.py` | One recorded cost, no model call |
147
- | `docs/` | [Index](docs/README.md) |
148
-
149
- Python SDK, FastAPI, Postgres, Redis, React. [MIT](LICENSE). [Contributing](CONTRIBUTING.md). [Security](SECURITY.md).
agentcogs-0.1.1/README.md DELETED
@@ -1,117 +0,0 @@
1
- # AgentCOGS
2
-
3
- **Which customer stops making money this month.**
4
-
5
- You sell an agent to other companies. The model provider sends one invoice. AgentCOGS splits that spend by the tenant who caused it, sets it against the monthly fee, and shows where the month is headed if the calls keep coming.
6
-
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
9
- [![CI](https://github.com/vaibhav11123/agentcogs/actions/workflows/ci.yml/badge.svg)](https://github.com/vaibhav11123/agentcogs/actions/workflows/ci.yml)
10
-
11
- The sample company is [Patternstack](https://agentcogs.vercel.app). One click, nothing to type. It is a snapshot of a fictional book of business, shipped in the dashboard, so it opens when no API is running. A hosted AgentCOGS API is not serving. To run your own customers, self-host.
12
-
13
- ---
14
-
15
- ## The book, and the account inside it
16
-
17
- Patternstack, as of 14 Nov 2026. Forty customers. The month so far looks healthy.
18
-
19
- | | So far | If the calls continue |
20
- | --- | ---: | ---: |
21
- | AI cost | $39,613.25 | $84,885.54 |
22
- | Fees | $155,918.00 | $155,918.00 |
23
- | Margin | 74.6% | 45.6% |
24
-
25
- The fee is the monthly amount on the account. Pace is a straight line from the cost so far. It does not forecast a change in behavior.
26
-
27
- Two accounts are where the month breaks. Vellum Research has cost $5,822.84 against an $8,200 fee: **29.0%** so far, 2,724 runs, and the largest node is `synthesize`. If that spend continues, the month ends near **−52.2%**. Pinnacle Claims is 35.0% so far and ends near −39.3%. The blended 74.6% does not show either of those.
28
-
29
- <p align="center">
30
- <img src="docs/assets/screenshots/patternstack-customers.png" alt="Patternstack customers. Blended margin 74.6%. Vellum Research is 29.0% and the month ends near −52.2%." width="880" />
31
- </p>
32
-
33
- Open the account and the same numbers sit next to the call that posted them.
34
-
35
- <p align="center">
36
- <img src="docs/assets/screenshots/vellum-research.png" alt="Vellum Research. Margin 29.0%, AI cost $5,822.84, fee $8,200, and the set_customer call that posts each run." width="880" />
37
- </p>
38
-
39
- ```python
40
- import agentcogs
41
-
42
- agentcogs.init() # AGENTCOGS_API_KEY, AGENTCOGS_WORKSPACE_ID, AGENTCOGS_ENDPOINT
43
- agentcogs.set_customer("vellum_research") # your tenant id, once per request
44
-
45
- with agentcogs.run(workflow_id="research_agent"):
46
- result = agent.invoke(state)
47
- ```
48
-
49
- The SDK does not call a model and does not invent the fee. It names the customer and posts the cost of the call you already made. You type the fee, or you pull the subscription from that customer's Stripe account. If no customer is set, the run stays unattributed.
50
-
51
- `python examples/one_run.py` posts one recorded $0.84 cost for Vellum Research so you can see a row land. It does not call a model.
52
-
53
- ---
54
-
55
- ## Look, then run it on yours
56
-
57
- **Look.** [agentcogs.vercel.app](https://agentcogs.vercel.app) → **Open Patternstack**.
58
-
59
- **Run.** From this repo:
60
-
61
- ```bash
62
- cp .env.selfhost.example .env
63
- docker compose up -d --build
64
- ```
65
-
66
- Open http://localhost:3000 and choose **Create my workspace**. No email. The next screen has the install command with your key in it. The package is not on PyPI yet:
67
-
68
- ```bash
69
- pip install "agentcogs @ git+https://github.com/vaibhav11123/agentcogs.git"
70
- ```
71
-
72
- Point `AGENTCOGS_ENDPOINT` at `http://localhost:8000`. Send one call, open that customer, and type the monthly fee. Margin is the fee minus the cost.
73
-
74
- Full steps: [docs/quickstart.md](docs/quickstart.md). Self-host notes: [docs/DEPLOY.md](docs/DEPLOY.md).
75
-
76
- ---
77
-
78
- ## Who it is for
79
-
80
- A founder of a product that sells one agent to many companies, priced as a monthly fee, with the model bill arriving as a single invoice. Support, research, claims, intake, document pipelines.
81
-
82
- | You already have | AgentCOGS adds |
83
- | --- | --- |
84
- | Langfuse or LangSmith | Which tenant the trace belonged to, and whether that tenant is still profitable |
85
- | LiteLLM | A callback that posts the tenant and the cost. The proxy stays |
86
- | Stripe | The subscription as the fee, and an optional meter for the usage you already attributed |
87
- | The provider invoice | The join from that one number to the customer list |
88
-
89
- ---
90
-
91
- ## What you can connect
92
-
93
- | | |
94
- | --- | --- |
95
- | [FastAPI](docs/integrations/fastapi.md) | Set the tenant from the request |
96
- | [LangGraph](docs/integrations/langgraph.md) | Wrap the graph |
97
- | [LiteLLM](docs/integrations/litellm.md) | Post proxy traffic without wrapping the app |
98
- | [Customer import](docs/integrations/customer-import.md) | Load names and fees before the first run |
99
- | [Slack](docs/integrations/slack.md) | A spike opens that customer |
100
- | Stripe | Pull subscription fees. Push a daily usage meter |
101
- | Budget | `monthly_budget_usd` raises `CustomerBudgetExceededError` before the next call |
102
-
103
- Terminal proof for the SDK, the outbox, and a live call: [docs/demo-paths.md](docs/demo-paths.md).
104
-
105
- ---
106
-
107
- ## Repo
108
-
109
- | Path | |
110
- | --- | --- |
111
- | `src/agentcogs/` | The SDK |
112
- | `backend/` | Ingest, margin, pace, budgets |
113
- | `dashboard/` | The book |
114
- | `examples/one_run.py` | One recorded cost, no model call |
115
- | `docs/` | [Index](docs/README.md) |
116
-
117
- Python SDK, FastAPI, Postgres, Redis, React. [MIT](LICENSE). [Contributing](CONTRIBUTING.md). [Security](SECURITY.md).
@@ -1 +0,0 @@
1
- __version__ = "0.1.1"
File without changes
File without changes