Repository navigation
feat: adding expensive AI deployment - #1
Closed
cloudsealed wants to merge 31 commits into
Closed
cloudsealed wants to merge 31 commits into
cloudsealed wants to merge 31 commits into
Conversation
Expanded the README to provide a detailed overview of the JIT-Optimization-Engine, including technical architecture, application in FinOps, and quick start instructions.
… compliance reporting
Library, CLI and FastAPI service sharing one analysis core: - parsing.py normalises AWS CUR / GCP / Azure / generic exports into a gap-free daily series, counting rejected rows instead of dropping them. - kernels.py: centred rolling median, MAD, modified z-score; numba- compiled when available with an identical pure-NumPy fallback. - analysis.py: day-of-week baseline, robust anomaly detection, waste metric and derived recommendations that state their assumptions. - cli.py and api.py expose the same analyze() with no second code path. Packaged for PyPI as cloudsealed-jit; 27 tests over parsing, analysis and the HTTP API.
- Dockerfile: multi-stage build, unprivileged runtime user, exposes 8091. - CI runs the test suite on Python 3.10-3.12 and reproduces the method benchmark as a regression gate. - CODE_OF_CONDUCT / COMMUNITY / CONTRIBUTING for open-source consumers.
benchmarks/masking_benchmark.py quantifies, on synthetic bills whose anomalies are known by construction (fixed seed, no private data), the advantage of the robust method over the textbook mean+stddev z-score: end-to-end F1 0.667 -> 1.000. Isolated scenarios attribute the gain to the MAD scale (masking) and the day-of-week baseline (seasonality) separately. --check runs in CI and fails on regression. METHODOLOGY.md documents the derivation and cites Iglewicz & Hoaglin (1993); architecture.md replaces the legacy HPMCE description with the real module layout.
The proven adoption pattern for this category (Infracost) is showing the finding where the developer already is, before merge — not a tool they have to remember to run. This composite action wraps the published cloudsealed-jit package: analyse a billing CSV in CI and post/update a single PR comment with the anomaly table and top recommendations (scripts/post_pr_comment.py, stdlib-only). An optional fail-on-severity gate blocks the merge on anomalies at or above a chosen severity (scripts/severity_gate.py). The repository dogfoods its own action in .github/workflows/example-usage.yml against examples/sample-billing.csv on every push, so the action is exercised by a real workflow run, not just unit tests.
Description/topics on GitHub still referenced the old LLVM/HFT scaffold; fixed via API to match the current billing anomaly detection scope.
Dead code from before the project became cloudsealed_jit — not referenced by the package, tests, CI, or docs (pyproject.toml already excludes src/ from the build). Confusing for external readers evaluating the repo.
Follow-up to ca09dec: this test only exercised the removed HFT scaffold, not the real cloudsealed_jit package. 27 tests pass without it.
- notify.py: optional webhookUrl on the API request and --webhook-url CLI flag, auto-detects Slack incoming webhooks, POSTs the full result to any other listener (Teams/PagerDuty/custom). Fires only on HIGH/CRITICAL anomalies; network failures never fail the analysis. - report.py: --html CLI flag writes a self-contained report (inline CSS, no CDN) for demos and sharing. Both were the most commonly cited gaps against commercial FinOps tools (Vantage, CloudZero, Finout) without pulling in a database or a served dashboard, which this project deliberately avoids.
FOCUS (FinOps Open Cost and Usage Specification) is the vendor-neutral billing format AWS/GCP/Azure/OCI now export natively. Recognizes its canonical columns (ChargePeriodStart, BilledCost/EffectiveCost, ServiceName), so one analysis runs across any cloud's export unchanged — the foundation for vendor-neutral multi-cloud analysis. The ISO-8601 date parser already handled FOCUS timestamps; this is column detection only. 2 new tests (39). AGENTS.md gives AI coding agents explicit when-to-use / when-not-to-use guidance so they pick this tool instead of re-deriving the method. Bump 0.2.2.
Anomaly detection is reactive — it reports a spike after it happens. The forecast is proactive: it extrapolates the observed level trend (rolling- median slope) forward, carries the same weekday seasonality the baseline uses, and — given a budget — predicts the day the trend crosses it. On a rising series this beats the old flat mean*30 run rate, which understates growth. It is a mechanical extrapolation, not a probabilistic prediction: the Forecast object exposes projectedSpend, dailyTrend, and budgetBreachDay so the number is auditable. Wired through CLI (--budget), API (optional budget field), and the MCP tool. The API response includes forecast only when requested (response_model_exclude_none), keeping the frozen Framework4D contract byte-identical. 44 tests + masking benchmark green. Bump 0.3.0.
Add two companion benchmarks alongside masking_benchmark.py so the IEEE Access paper's comparison against established detectors is reproducible from the repo: - sota_comparison.py: full shipped method vs Isolation Forest, STL residual + 3-sigma, and Seasonal-Hybrid ESD on the same three scenarios (same seeds, same ground-truth scoring). - montecarlo_robustness.py: repeats each scenario over N randomized trials (random spike positions, jittered magnitudes, fresh noise) and reports mean +/- std F1 plus the win rate of the shipped method. Extra detectors live behind a new optional 'bench' extra (scikit-learn, statsmodels, scipy); the core package and the headline masking benchmark keep numpy as their only runtime dependency, so CI is unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Shape the synthetic end-to-end bill from a real Google Cloud service mix (gcp_calibrated_profile.json: service-level proportions only, no account or project identifiers, no amounts) so the benchmark's structure -- a ~79% always-on database floor plus ~21% deploy/traffic-driven services -- is real rather than invented. Only the structure is calibrated from real data; the weekly seasonality and labeled anomalies are injected synthetically, keeping ground truth exact. On this harder, more realistic series the shipped method still leads every detector (mean F1 1.000 vs 0.968 for the next best over 300 randomized runs). Co-Authored-By: Claude Opus 4.8 <[email protected]>
…e historical baseline and AI Firewall features
💰 cloudsealed-jit — billing waste auditAnalysed 31 day(s) of billing (124 line items) totalling USD 23,990.88. Mean daily spend USD 773.90, stability ratio 1.86. 3 anomalous day(s) detected; 11.9% of total spend sits above the modelled baseline. Identified up to USD 16,341.33 in addressable monthly spend.
Anomalies
Top recommendations
Generated by cloudsealed-jit — rolling-median baseline + MAD z-score, method in METHODOLOGY.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.