lutflow 0.1.0a1__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.
Potentially problematic release.
This version of lutflow might be problematic. Click here for more details.
- lutflow-0.1.0a1/.gitignore +250 -0
- lutflow-0.1.0a1/LICENSE +107 -0
- lutflow-0.1.0a1/PKG-INFO +295 -0
- lutflow-0.1.0a1/README.md +140 -0
- lutflow-0.1.0a1/docs/DEMO_SCRIPT.md +99 -0
- lutflow-0.1.0a1/docs/PUBLISHING.md +76 -0
- lutflow-0.1.0a1/docs/TINYFISH_INTEGRATION.md +103 -0
- lutflow-0.1.0a1/docs/USAGE.md +274 -0
- lutflow-0.1.0a1/examples/tinyfish_gpu_lookup.py +93 -0
- lutflow-0.1.0a1/lutflow/__init__.py +27 -0
- lutflow-0.1.0a1/lutflow/budget.py +161 -0
- lutflow-0.1.0a1/lutflow/cli.py +329 -0
- lutflow-0.1.0a1/lutflow/client.py +304 -0
- lutflow-0.1.0a1/lutflow/executors/__init__.py +5 -0
- lutflow-0.1.0a1/lutflow/executors/self_kill.py +191 -0
- lutflow-0.1.0a1/lutflow/kafka/__init__.py +3 -0
- lutflow-0.1.0a1/lutflow/pcpo.py +367 -0
- lutflow-0.1.0a1/lutflow/pricing.py +174 -0
- lutflow-0.1.0a1/lutflow/py.typed +0 -0
- lutflow-0.1.0a1/lutflow/tinyfish.py +168 -0
- lutflow-0.1.0a1/lutflow/wrappers/__init__.py +3 -0
- lutflow-0.1.0a1/lutflow/wrappers/anthropic.py +336 -0
- lutflow-0.1.0a1/lutflow/wrappers/openai.py +276 -0
- lutflow-0.1.0a1/pyproject.toml +81 -0
- lutflow-0.1.0a1/tests/conftest.py +53 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Lutflow .gitignore
|
|
2
|
+
# Enterprise MLOps Platform
|
|
3
|
+
# =========================
|
|
4
|
+
|
|
5
|
+
# ============================================
|
|
6
|
+
# OS Generated Files
|
|
7
|
+
# ============================================
|
|
8
|
+
.DS_Store
|
|
9
|
+
.DS_Store?
|
|
10
|
+
._*
|
|
11
|
+
.Spotlight-V100
|
|
12
|
+
.Trashes
|
|
13
|
+
ehthumbs.db
|
|
14
|
+
Thumbs.db
|
|
15
|
+
*.swp
|
|
16
|
+
*.swo
|
|
17
|
+
*~
|
|
18
|
+
|
|
19
|
+
# ============================================
|
|
20
|
+
# IDE / Editor
|
|
21
|
+
# ============================================
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
*.sublime-workspace
|
|
25
|
+
*.sublime-project
|
|
26
|
+
.cursor/
|
|
27
|
+
.claude/
|
|
28
|
+
.cursorrules
|
|
29
|
+
|
|
30
|
+
# ============================================
|
|
31
|
+
# Environment & Secrets
|
|
32
|
+
# ============================================
|
|
33
|
+
.env
|
|
34
|
+
.env.demo
|
|
35
|
+
.env.local
|
|
36
|
+
.env.*.local
|
|
37
|
+
*.env
|
|
38
|
+
.envrc
|
|
39
|
+
.secrets
|
|
40
|
+
secrets/
|
|
41
|
+
*.pem
|
|
42
|
+
*.key
|
|
43
|
+
credentials*.json
|
|
44
|
+
|
|
45
|
+
# ============================================
|
|
46
|
+
# Go
|
|
47
|
+
# ============================================
|
|
48
|
+
*.exe
|
|
49
|
+
*.exe~
|
|
50
|
+
*.dll
|
|
51
|
+
*.so
|
|
52
|
+
*.dylib
|
|
53
|
+
bin/
|
|
54
|
+
services/*/bin/
|
|
55
|
+
services/*/tmp/
|
|
56
|
+
*.test
|
|
57
|
+
*.out
|
|
58
|
+
coverage.html
|
|
59
|
+
vendor/
|
|
60
|
+
go.work.sum
|
|
61
|
+
|
|
62
|
+
# ============================================
|
|
63
|
+
# Python
|
|
64
|
+
# ============================================
|
|
65
|
+
__pycache__/
|
|
66
|
+
*.py[cod]
|
|
67
|
+
*$py.class
|
|
68
|
+
.venv/
|
|
69
|
+
venv/
|
|
70
|
+
ENV/
|
|
71
|
+
env/
|
|
72
|
+
.python-version
|
|
73
|
+
build/
|
|
74
|
+
develop-eggs/
|
|
75
|
+
dist/
|
|
76
|
+
downloads/
|
|
77
|
+
eggs/
|
|
78
|
+
.eggs/
|
|
79
|
+
lib/
|
|
80
|
+
lib64/
|
|
81
|
+
parts/
|
|
82
|
+
sdist/
|
|
83
|
+
var/
|
|
84
|
+
wheels/
|
|
85
|
+
*.egg-info/
|
|
86
|
+
.installed.cfg
|
|
87
|
+
*.egg
|
|
88
|
+
pip-log.txt
|
|
89
|
+
pip-delete-this-directory.txt
|
|
90
|
+
htmlcov/
|
|
91
|
+
.tox/
|
|
92
|
+
.nox/
|
|
93
|
+
.coverage
|
|
94
|
+
.coverage.*
|
|
95
|
+
.cache
|
|
96
|
+
nosetests.xml
|
|
97
|
+
coverage.xml
|
|
98
|
+
*.cover
|
|
99
|
+
.hypothesis/
|
|
100
|
+
.pytest_cache/
|
|
101
|
+
.mypy_cache/
|
|
102
|
+
.dmypy.json
|
|
103
|
+
dmypy.json
|
|
104
|
+
.ruff_cache/
|
|
105
|
+
uv.lock
|
|
106
|
+
.ipynb_checkpoints
|
|
107
|
+
|
|
108
|
+
# ============================================
|
|
109
|
+
# Node.js / Next.js
|
|
110
|
+
# ============================================
|
|
111
|
+
node_modules/
|
|
112
|
+
.pnpm-store/
|
|
113
|
+
apps/web/.next/
|
|
114
|
+
apps/web/out/
|
|
115
|
+
apps/web/build/
|
|
116
|
+
.turbo/
|
|
117
|
+
.vercel/
|
|
118
|
+
|
|
119
|
+
# ============================================
|
|
120
|
+
# Docker
|
|
121
|
+
# ============================================
|
|
122
|
+
docker/data/
|
|
123
|
+
*.log
|
|
124
|
+
|
|
125
|
+
# ============================================
|
|
126
|
+
# Terraform
|
|
127
|
+
# ============================================
|
|
128
|
+
.terraform/
|
|
129
|
+
*.tfstate
|
|
130
|
+
*.tfstate.*
|
|
131
|
+
*.tfvars
|
|
132
|
+
!example.tfvars
|
|
133
|
+
.terraform.lock.hcl
|
|
134
|
+
|
|
135
|
+
# ============================================
|
|
136
|
+
# ML Artifacts (use MinIO/S3)
|
|
137
|
+
# ============================================
|
|
138
|
+
*.h5
|
|
139
|
+
*.hdf5
|
|
140
|
+
*.pkl
|
|
141
|
+
*.pickle
|
|
142
|
+
*.joblib
|
|
143
|
+
*.model
|
|
144
|
+
*.pt
|
|
145
|
+
*.pth
|
|
146
|
+
*.onnx
|
|
147
|
+
/models/ # Root-level ML models dir only — NOT services/*/models (Go packages)
|
|
148
|
+
artifacts/
|
|
149
|
+
mlruns/
|
|
150
|
+
luts/
|
|
151
|
+
|
|
152
|
+
# ============================================
|
|
153
|
+
# Logs & Debug
|
|
154
|
+
# ============================================
|
|
155
|
+
logs/
|
|
156
|
+
*.log
|
|
157
|
+
npm-debug.log*
|
|
158
|
+
yarn-debug.log*
|
|
159
|
+
yarn-error.log*
|
|
160
|
+
pnpm-debug.log*
|
|
161
|
+
|
|
162
|
+
# ============================================
|
|
163
|
+
# Testing
|
|
164
|
+
# ============================================
|
|
165
|
+
coverage/
|
|
166
|
+
.nyc_output/
|
|
167
|
+
test-results/
|
|
168
|
+
playwright-report/
|
|
169
|
+
|
|
170
|
+
# ============================================
|
|
171
|
+
# Local Development / Temporary Files
|
|
172
|
+
# ============================================
|
|
173
|
+
backup/
|
|
174
|
+
*.bak
|
|
175
|
+
*.tmp
|
|
176
|
+
*.temp
|
|
177
|
+
quick_test.py
|
|
178
|
+
demo_*.py
|
|
179
|
+
test_*.py
|
|
180
|
+
!services/**/test_*.py
|
|
181
|
+
!services/**/tests/
|
|
182
|
+
|
|
183
|
+
# ============================================
|
|
184
|
+
# Documentation (Internal Only - Root Level)
|
|
185
|
+
# Keep docs/ folder for public documentation
|
|
186
|
+
# ============================================
|
|
187
|
+
/AUDIT_*.md
|
|
188
|
+
/AUDITORIA_*.md
|
|
189
|
+
/*COMPLETE*.md
|
|
190
|
+
/*PROGRESS*.md
|
|
191
|
+
/*REPORT*.md
|
|
192
|
+
/MEGA_PROMPT_*.md
|
|
193
|
+
/PLAN_MAESTRO*.md
|
|
194
|
+
/compass_artifact*.md
|
|
195
|
+
/INFORME_*.md
|
|
196
|
+
/ESTADO_*.md
|
|
197
|
+
/EXECUTION_PLAN*.md
|
|
198
|
+
/RELEASE_*.txt
|
|
199
|
+
/SPRINT_*.md
|
|
200
|
+
/VERIFICATION_*.md
|
|
201
|
+
/VERIFICACION_*.md
|
|
202
|
+
/VERIFICADO*.md
|
|
203
|
+
/VAULT_*.md
|
|
204
|
+
/QA_*.md
|
|
205
|
+
/TESTING_GUIDE.md
|
|
206
|
+
/COMPREHENSIVE_*.md
|
|
207
|
+
/BENTOML_*.md
|
|
208
|
+
/OPERACIONALIZACION_*.md
|
|
209
|
+
/PCPO_*.md
|
|
210
|
+
/FLYWHEEL_*.md
|
|
211
|
+
/LUTFLOW_*.md
|
|
212
|
+
!/LUTFLOW_GROUP_B_TECHNICAL_REPORT.md
|
|
213
|
+
!/LUTFLOW_S0_GONOGO_REPORT.md
|
|
214
|
+
/Refactorizaci*.md
|
|
215
|
+
/FASE_*.md
|
|
216
|
+
/SISTEMA_*.md
|
|
217
|
+
/info.md
|
|
218
|
+
/test-vault.sh
|
|
219
|
+
|
|
220
|
+
# ============================================
|
|
221
|
+
# Transcriptions & Research
|
|
222
|
+
# ============================================
|
|
223
|
+
transcrip_AWS_AI/
|
|
224
|
+
|
|
225
|
+
# ============================================
|
|
226
|
+
# Images (except docs)
|
|
227
|
+
# ============================================
|
|
228
|
+
*.png
|
|
229
|
+
*.jpg
|
|
230
|
+
*.jpeg
|
|
231
|
+
*.gif
|
|
232
|
+
!docs/**/*.png
|
|
233
|
+
!docs/**/*.jpg
|
|
234
|
+
|
|
235
|
+
# ============================================
|
|
236
|
+
# Local Scripts (Windows)
|
|
237
|
+
# ============================================
|
|
238
|
+
*.bat
|
|
239
|
+
start-lutflow.ps1
|
|
240
|
+
|
|
241
|
+
# ============================================
|
|
242
|
+
# MCP Config (Local)
|
|
243
|
+
# ============================================
|
|
244
|
+
.mcp.json
|
|
245
|
+
|
|
246
|
+
# ============================================
|
|
247
|
+
# Local SDK / Tooling Downloads
|
|
248
|
+
# ============================================
|
|
249
|
+
google-cloud-sdk/
|
|
250
|
+
google-cloud-sdk-*.tar.gz
|
lutflow-0.1.0a1/LICENSE
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Lutflow Inc.
|
|
6
|
+
Licensed Work: Lutflow SDK
|
|
7
|
+
The Licensed Work is (c) 2026 Lutflow Inc.
|
|
8
|
+
Additional Use Grant: You may make use of the Licensed Work, provided that
|
|
9
|
+
you do not use the Licensed Work for a GPU Cost Management
|
|
10
|
+
Service.
|
|
11
|
+
|
|
12
|
+
A "GPU Cost Management Service" is a commercial offering
|
|
13
|
+
that allows third parties to access the functionality of
|
|
14
|
+
the Licensed Work by performing any of the following:
|
|
15
|
+
(a) offering budget enforcement, cost tracking, or kill-path
|
|
16
|
+
functionality for GPU or AI inference workloads as a
|
|
17
|
+
managed service;
|
|
18
|
+
(b) offering the Licensed Work to third parties as a
|
|
19
|
+
commercial cloud service, hosted service, or
|
|
20
|
+
software-as-a-service.
|
|
21
|
+
|
|
22
|
+
For clarity, the following uses are permitted:
|
|
23
|
+
- Internal use within your organization
|
|
24
|
+
- Development, testing, and evaluation
|
|
25
|
+
- Non-commercial and educational use
|
|
26
|
+
- Integration into your own products that do not compete
|
|
27
|
+
with Lutflow's commercial offerings
|
|
28
|
+
|
|
29
|
+
Change Date: March 29, 2030
|
|
30
|
+
Change License: Apache License, Version 2.0
|
|
31
|
+
|
|
32
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
33
|
+
please contact: licensing@lutflow.com
|
|
34
|
+
|
|
35
|
+
-----------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
Business Source License 1.1
|
|
38
|
+
|
|
39
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
40
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
41
|
+
|
|
42
|
+
Terms
|
|
43
|
+
|
|
44
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
45
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
46
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
47
|
+
production use.
|
|
48
|
+
|
|
49
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
50
|
+
available distribution of a specific version of the Licensed Work under this
|
|
51
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
52
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
53
|
+
above terminate.
|
|
54
|
+
|
|
55
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
56
|
+
currently in effect as described in this License, you must purchase a
|
|
57
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
58
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
59
|
+
|
|
60
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
61
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
62
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
63
|
+
for each version of the Licensed Work released by Licensor.
|
|
64
|
+
|
|
65
|
+
You must conspicuously display this License on each original or modified copy
|
|
66
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
67
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
68
|
+
License apply to your use of that work.
|
|
69
|
+
|
|
70
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
71
|
+
terminate your rights under this License for the current and all other
|
|
72
|
+
versions of the Licensed Work.
|
|
73
|
+
|
|
74
|
+
This License does not grant you any right in any trademark or logo of
|
|
75
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
76
|
+
Licensor as expressly required by this License).
|
|
77
|
+
|
|
78
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
79
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
80
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
81
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
82
|
+
TITLE.
|
|
83
|
+
|
|
84
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
85
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
86
|
+
as long as you comply with the Covenants of Licensor below.
|
|
87
|
+
|
|
88
|
+
Covenants of Licensor
|
|
89
|
+
|
|
90
|
+
In consideration of the right to use this License's text and the "Business
|
|
91
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
92
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
93
|
+
|
|
94
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
95
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
96
|
+
where "compatible" means that software provided under the Change License can
|
|
97
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
98
|
+
later version. Licensor may specify additional Change Licenses without
|
|
99
|
+
limitation.
|
|
100
|
+
|
|
101
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
102
|
+
impose any additional restriction on the right granted in this License, as
|
|
103
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
104
|
+
|
|
105
|
+
3. To specify a Change Date.
|
|
106
|
+
|
|
107
|
+
4. Not to modify this License in any other way.
|
lutflow-0.1.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lutflow
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: GPU Financial Firewall — budget enforcement for AI inference
|
|
5
|
+
Project-URL: Homepage, https://lutflow.dev
|
|
6
|
+
Project-URL: Documentation, https://docs.lutflow.dev/sdk/python
|
|
7
|
+
Project-URL: Repository, https://github.com/Lutflow/lutflow
|
|
8
|
+
Project-URL: Issues, https://github.com/Lutflow/lutflow/issues
|
|
9
|
+
Author-email: "Lutflow Inc." <oscar@lutflow.com>
|
|
10
|
+
License: Business Source License 1.1
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
|
|
14
|
+
Licensor: Lutflow Inc.
|
|
15
|
+
Licensed Work: Lutflow SDK
|
|
16
|
+
The Licensed Work is (c) 2026 Lutflow Inc.
|
|
17
|
+
Additional Use Grant: You may make use of the Licensed Work, provided that
|
|
18
|
+
you do not use the Licensed Work for a GPU Cost Management
|
|
19
|
+
Service.
|
|
20
|
+
|
|
21
|
+
A "GPU Cost Management Service" is a commercial offering
|
|
22
|
+
that allows third parties to access the functionality of
|
|
23
|
+
the Licensed Work by performing any of the following:
|
|
24
|
+
(a) offering budget enforcement, cost tracking, or kill-path
|
|
25
|
+
functionality for GPU or AI inference workloads as a
|
|
26
|
+
managed service;
|
|
27
|
+
(b) offering the Licensed Work to third parties as a
|
|
28
|
+
commercial cloud service, hosted service, or
|
|
29
|
+
software-as-a-service.
|
|
30
|
+
|
|
31
|
+
For clarity, the following uses are permitted:
|
|
32
|
+
- Internal use within your organization
|
|
33
|
+
- Development, testing, and evaluation
|
|
34
|
+
- Non-commercial and educational use
|
|
35
|
+
- Integration into your own products that do not compete
|
|
36
|
+
with Lutflow's commercial offerings
|
|
37
|
+
|
|
38
|
+
Change Date: March 29, 2030
|
|
39
|
+
Change License: Apache License, Version 2.0
|
|
40
|
+
|
|
41
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
42
|
+
please contact: licensing@lutflow.com
|
|
43
|
+
|
|
44
|
+
-----------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
Business Source License 1.1
|
|
47
|
+
|
|
48
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
49
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
50
|
+
|
|
51
|
+
Terms
|
|
52
|
+
|
|
53
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
54
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
55
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
56
|
+
production use.
|
|
57
|
+
|
|
58
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
59
|
+
available distribution of a specific version of the Licensed Work under this
|
|
60
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
61
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
62
|
+
above terminate.
|
|
63
|
+
|
|
64
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
65
|
+
currently in effect as described in this License, you must purchase a
|
|
66
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
67
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
68
|
+
|
|
69
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
70
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
71
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
72
|
+
for each version of the Licensed Work released by Licensor.
|
|
73
|
+
|
|
74
|
+
You must conspicuously display this License on each original or modified copy
|
|
75
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
76
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
77
|
+
License apply to your use of that work.
|
|
78
|
+
|
|
79
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
80
|
+
terminate your rights under this License for the current and all other
|
|
81
|
+
versions of the Licensed Work.
|
|
82
|
+
|
|
83
|
+
This License does not grant you any right in any trademark or logo of
|
|
84
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
85
|
+
Licensor as expressly required by this License).
|
|
86
|
+
|
|
87
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
88
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
89
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
90
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
91
|
+
TITLE.
|
|
92
|
+
|
|
93
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
94
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
95
|
+
as long as you comply with the Covenants of Licensor below.
|
|
96
|
+
|
|
97
|
+
Covenants of Licensor
|
|
98
|
+
|
|
99
|
+
In consideration of the right to use this License's text and the "Business
|
|
100
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
101
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
102
|
+
|
|
103
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
104
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
105
|
+
where "compatible" means that software provided under the Change License can
|
|
106
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
107
|
+
later version. Licensor may specify additional Change Licenses without
|
|
108
|
+
limitation.
|
|
109
|
+
|
|
110
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
111
|
+
impose any additional restriction on the right granted in this License, as
|
|
112
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
113
|
+
|
|
114
|
+
3. To specify a Change Date.
|
|
115
|
+
|
|
116
|
+
4. Not to modify this License in any other way.
|
|
117
|
+
License-File: LICENSE
|
|
118
|
+
Keywords: ai,anthropic,budget,cost-management,enforcement,finops,gpu,llm,openai
|
|
119
|
+
Classifier: Development Status :: 3 - Alpha
|
|
120
|
+
Classifier: Intended Audience :: Developers
|
|
121
|
+
Classifier: License :: Other/Proprietary License
|
|
122
|
+
Classifier: Programming Language :: Python :: 3
|
|
123
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
124
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
125
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
126
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
127
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
128
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
129
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
130
|
+
Requires-Python: >=3.9
|
|
131
|
+
Requires-Dist: click>=8.1.0
|
|
132
|
+
Requires-Dist: httpx>=0.25.0
|
|
133
|
+
Requires-Dist: pydantic>=2.0.0
|
|
134
|
+
Requires-Dist: rich>=13.0.0
|
|
135
|
+
Requires-Dist: tiktoken>=0.5.0
|
|
136
|
+
Provides-Extra: all
|
|
137
|
+
Requires-Dist: anthropic>=1.0.0; extra == 'all'
|
|
138
|
+
Requires-Dist: confluent-kafka>=2.3.0; extra == 'all'
|
|
139
|
+
Requires-Dist: fastavro>=1.9.0; extra == 'all'
|
|
140
|
+
Requires-Dist: openai>=1.0.0; extra == 'all'
|
|
141
|
+
Provides-Extra: anthropic
|
|
142
|
+
Requires-Dist: anthropic>=0.18.0; extra == 'anthropic'
|
|
143
|
+
Provides-Extra: dev
|
|
144
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
145
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
146
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
147
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
148
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
149
|
+
Provides-Extra: kafka
|
|
150
|
+
Requires-Dist: confluent-kafka>=2.3.0; extra == 'kafka'
|
|
151
|
+
Requires-Dist: fastavro>=1.9.0; extra == 'kafka'
|
|
152
|
+
Provides-Extra: openai
|
|
153
|
+
Requires-Dist: openai>=1.0.0; extra == 'openai'
|
|
154
|
+
Description-Content-Type: text/markdown
|
|
155
|
+
|
|
156
|
+
# Lutflow — GPU Financial Firewall
|
|
157
|
+
|
|
158
|
+
Budget enforcement for AI inference workloads. Track costs, enforce budgets, kill runaway GPU spending in real time.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
pip install lutflow
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## 5-Line Quickstart
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from lutflow import Client
|
|
168
|
+
import openai
|
|
169
|
+
|
|
170
|
+
client = Client(tenant_id="acme", budget_usd=10.00)
|
|
171
|
+
wrapped = client.wrap(openai.OpenAI())
|
|
172
|
+
response = wrapped.chat.completions.create(model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}])
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Lutflow tracks every token, calculates cost, and terminates the process if the budget is exceeded.
|
|
176
|
+
|
|
177
|
+
## CLI
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# GPU price lookup (powered by TinyFish)
|
|
181
|
+
lutflow lookup --gpu nvidia-l4
|
|
182
|
+
|
|
183
|
+
# Deploy with budget enforcement
|
|
184
|
+
lutflow deploy --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --budget 0.10
|
|
185
|
+
|
|
186
|
+
# Live dashboard
|
|
187
|
+
lutflow watch
|
|
188
|
+
|
|
189
|
+
# Check deployment status
|
|
190
|
+
lutflow status <deployment_id>
|
|
191
|
+
|
|
192
|
+
# Manual kill
|
|
193
|
+
lutflow kill <deployment_id> --reason overspend
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Installation
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
pip install lutflow # Core + CLI
|
|
200
|
+
pip install lutflow[openai] # With OpenAI wrapper
|
|
201
|
+
pip install lutflow[anthropic] # With Anthropic wrapper
|
|
202
|
+
pip install lutflow[all] # All providers + Kafka transport
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## SDK Usage
|
|
206
|
+
|
|
207
|
+
### Token-Based Pricing (API Providers)
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from lutflow import Client, BudgetStrategy
|
|
211
|
+
|
|
212
|
+
client = Client(
|
|
213
|
+
tenant_id="my-tenant",
|
|
214
|
+
api_key="lut_xxx",
|
|
215
|
+
budget_usd=10.00,
|
|
216
|
+
on_budget_exceeded=BudgetStrategy.RAISE_ERROR,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
wrapped = client.wrap(openai.OpenAI())
|
|
220
|
+
response = wrapped.chat.completions.create(
|
|
221
|
+
model="gpt-4o",
|
|
222
|
+
messages=[{"role": "user", "content": "Hello!"}],
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
print(f"Spent: ${client.accumulated_cost_usd:.4f}")
|
|
226
|
+
print(f"Remaining: ${client.remaining_budget_usd:.4f}")
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### GPU-Time Pricing (Self-Hosted Models)
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from lutflow import Client, PricingMode
|
|
233
|
+
|
|
234
|
+
client = Client(
|
|
235
|
+
tenant_id="my-tenant",
|
|
236
|
+
budget_usd=5.00,
|
|
237
|
+
pricing_mode=PricingMode.GPU_TIME,
|
|
238
|
+
gpu_type="nvidia-l4",
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
client.start_gpu_timer()
|
|
242
|
+
# ... run inference ...
|
|
243
|
+
cost = client.stop_gpu_timer()
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### GPU Price Lookup (TinyFish)
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from lutflow.tinyfish import TinyFishClient
|
|
250
|
+
|
|
251
|
+
tf = TinyFishClient() # Uses TINYFISH_API_KEY env var
|
|
252
|
+
result = tf.fetch_all_prices(gpu_type="nvidia-l4")
|
|
253
|
+
|
|
254
|
+
best = result.cheapest
|
|
255
|
+
print(f"Cheapest: {best.provider} at ${best.spot_usd_per_hour:.2f}/hr")
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Budget Strategies
|
|
259
|
+
|
|
260
|
+
| Strategy | Behavior |
|
|
261
|
+
|----------|----------|
|
|
262
|
+
| `SELF_KILL` | Sends `SIGKILL` to the process (default) |
|
|
263
|
+
| `RAISE_ERROR` | Raises `BudgetExceededError` |
|
|
264
|
+
| `WARN_ONLY` | Logs warning, continues execution |
|
|
265
|
+
| `CALLBACK` | Calls a custom function you provide |
|
|
266
|
+
|
|
267
|
+
## Supported Providers
|
|
268
|
+
|
|
269
|
+
- **OpenAI** — GPT-4o, GPT-4, GPT-3.5, embeddings
|
|
270
|
+
- **Anthropic** — Claude 3.5, Claude 3 Opus/Sonnet/Haiku
|
|
271
|
+
- **Google** — Gemini 1.5 Pro/Flash
|
|
272
|
+
- **Self-hosted** — vLLM, TGI, BentoML (GPU-time pricing)
|
|
273
|
+
|
|
274
|
+
## Environment Variables
|
|
275
|
+
|
|
276
|
+
| Variable | Description |
|
|
277
|
+
|----------|-------------|
|
|
278
|
+
| `LUTFLOW_ENDPOINT` | API endpoint (default: `https://api.lutflow.dev`) |
|
|
279
|
+
| `TINYFISH_API_KEY` | TinyFish API key for live GPU pricing |
|
|
280
|
+
|
|
281
|
+
## Links
|
|
282
|
+
|
|
283
|
+
- **Website**: [lutflow.dev](https://lutflow.dev)
|
|
284
|
+
- **Docs**: [docs.lutflow.dev/sdk/python](https://docs.lutflow.dev/sdk/python)
|
|
285
|
+
- **GitHub**: [github.com/Lutflow/lutflow](https://github.com/Lutflow/lutflow)
|
|
286
|
+
|
|
287
|
+
## License
|
|
288
|
+
|
|
289
|
+
Business Source License 1.1 (BSL 1.1)
|
|
290
|
+
|
|
291
|
+
- **Free for**: internal use, development, testing, evaluation, non-commercial use
|
|
292
|
+
- **Commercial license required for**: offering GPU cost management as a service
|
|
293
|
+
- **Change Date**: March 29, 2030 (converts to Apache 2.0)
|
|
294
|
+
|
|
295
|
+
See [LICENSE](LICENSE) for full terms. For commercial licensing: licensing@lutflow.com
|