diff --git a/CHANGELOG.md b/CHANGELOG.md index bafc268..459e605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ verbatim as the body of the matching GitHub release. | Version | Date | Notes | |---|---|---| +| v0.2.9 | 2026-11-24 | [changelog/v0.2.9.md](changelog/v0.2.9.md) | | v0.2.8 | 2026-11-24 | [changelog/v0.2.8.md](changelog/v0.2.8.md) | | v0.2.7 | 2026-11-23 | [changelog/v0.2.7.md](changelog/v0.2.7.md) | | v0.2.6 | 2026-11-23 | [changelog/v0.2.6.md](changelog/v0.2.6.md) | diff --git a/changelog/v0.2.9.md b/changelog/v0.2.9.md new file mode 100644 index 0000000..389b273 --- /dev/null +++ b/changelog/v0.2.9.md @@ -0,0 +1,14 @@ +# v0.2.9 + +Response-cache hits are visible on the dashboard. + +## Added + +- `/admin/stats` now reports `cache.exact_hits` alongside `semantic_hits`, so Path's own + exact-match response cache can be distinguished from provider prompt caching. +- The dashboard Cache card shows exact hits, semantic hits and cached prompt tokens. + +## Changed + +- The Cache card labels its percentage as `prompt cache`, making clear that the hit + ratio is provider prompt-cache usage rather than the response-cache hit count. diff --git a/deploy/dokploy/README.md b/deploy/dokploy/README.md index 08ee683..d635acc 100644 --- a/deploy/dokploy/README.md +++ b/deploy/dokploy/README.md @@ -20,7 +20,7 @@ database. The console is always a plain Application. 3. Compose path: `deploy/dokploy/compose.yml`. 4. **Trigger Type: On Tag**, with auto-deploy enabled. The gateway is a production service; a pull request or a push to `Develop` must not restart it. A release tag - (`v0.2.8`) is the only thing that deploys — see "When it deploys" below. + (`v0.2.9`) is the only thing that deploys — see "When it deploys" below. 5. **Environment** (the compose file references all of these): ```bash diff --git a/docs/SPRING-AI.md b/docs/SPRING-AI.md index bcd63df..8553f3a 100644 --- a/docs/SPRING-AI.md +++ b/docs/SPRING-AI.md @@ -13,7 +13,7 @@ on Spring AI; the gateway never depends on it. io.github.an1ndra path-spring-ai - 0.2.8 + 0.2.9 ``` diff --git a/path-gateway/pom.xml b/path-gateway/pom.xml index c5b770e..72854ee 100644 --- a/path-gateway/pom.xml +++ b/path-gateway/pom.xml @@ -7,7 +7,7 @@ io.github.an1ndra path-parent - 0.2.8 + 0.2.9 ../pom.xml diff --git a/path-gateway/src/main/java/com/anindra/path/admin/AdminReportingService.java b/path-gateway/src/main/java/com/anindra/path/admin/AdminReportingService.java index 006e711..b1f8ae4 100644 --- a/path-gateway/src/main/java/com/anindra/path/admin/AdminReportingService.java +++ b/path-gateway/src/main/java/com/anindra/path/admin/AdminReportingService.java @@ -322,6 +322,8 @@ private Map projectStats(Long projectId, Duration window) { cache.put("savings_usd", savings); cache.put("semantic_hits", rows.stream() .filter(r -> "semantic".equals(r.getCacheTier())).count()); + cache.put("exact_hits", rows.stream() + .filter(r -> "exact".equals(r.getCacheTier())).count()); out.put("cache", cache); out.put("fallback_requests", rows.stream().filter(r -> r.getAttempts() > 1).count()); out.put("estimated_usage_requests", rows.stream().filter(UsageRecord::isUsageEstimated).count()); diff --git a/path-gateway/src/main/java/com/anindra/path/gateway/UsageService.java b/path-gateway/src/main/java/com/anindra/path/gateway/UsageService.java index 9230fe4..7e63d86 100644 --- a/path-gateway/src/main/java/com/anindra/path/gateway/UsageService.java +++ b/path-gateway/src/main/java/com/anindra/path/gateway/UsageService.java @@ -405,6 +405,7 @@ public Map adminStats(Duration window) { cache.put("hit_ratio", ratio(cachedTokens, promptTokens)); cache.put("savings_usd", savings); cache.put("semantic_hits", usage.countByCreatedAtAfterAndCacheTier(from, "semantic")); + cache.put("exact_hits", usage.countByCreatedAtAfterAndCacheTier(from, "exact")); out.put("cache", cache); out.put("fallback_requests", usage.countByAttemptsGreaterThanAndCreatedAtAfter(1, from)); diff --git a/path-gateway/src/test/java/com/anindra/path/SemanticHitStatsTest.java b/path-gateway/src/test/java/com/anindra/path/SemanticHitStatsTest.java index 06d3330..378b6dc 100644 --- a/path-gateway/src/test/java/com/anindra/path/SemanticHitStatsTest.java +++ b/path-gateway/src/test/java/com/anindra/path/SemanticHitStatsTest.java @@ -79,6 +79,7 @@ void semanticHitsComeFromTheWindowRatherThanMemory() { Map stats = reporting.stats("24h", null, null); assertThat(cache(stats).get("semantic_hits")).isEqualTo(2L); + assertThat(cache(stats).get("exact_hits")).isEqualTo(1L); } @Test @@ -96,6 +97,7 @@ void aProjectCountsOnlyItsOwnSemanticHits() { Map stats = reporting.stats("24h", projectId, null); assertThat(cache(stats).get("semantic_hits")).isEqualTo(1L); + assertThat(cache(stats).get("exact_hits")).isEqualTo(0L); } @Test @@ -103,5 +105,6 @@ void anEmptyWindowReportsZeroRatherThanNothing() { Map stats = reporting.stats("24h", null, null); assertThat(cache(stats).get("semantic_hits")).isEqualTo(0L); + assertThat(cache(stats).get("exact_hits")).isEqualTo(0L); } } diff --git a/path-spring-ai/pom.xml b/path-spring-ai/pom.xml index 4dbd481..99ebfac 100644 --- a/path-spring-ai/pom.xml +++ b/path-spring-ai/pom.xml @@ -7,7 +7,7 @@ io.github.an1ndra path-parent - 0.2.8 + 0.2.9 ../pom.xml diff --git a/pom.xml b/pom.xml index ec3a81b..ab9b4b4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ io.github.an1ndra path-parent - 0.2.8 + 0.2.9 pom path-parent Build parent for Path, the provider-agnostic LLM gateway, and its Spring AI adapter