feat: switch free AI tier to DeepSeek with daily cost budgets

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Diego Imbert
2026-07-14 13:14:13 +02:00
co-authored by Claude Opus 4.8
parent 0258f03479
commit 4cb021c07b
8 changed files with 33 additions and 31 deletions
+2 -2
View File
@@ -962,7 +962,7 @@ async fn proxy(
if let Some(lease) = free_lease {
let body = if is_sse {
axum::body::Body::from_stream(inject_keepalives(
Box::pin(crate::ai_free_tier_oss::meter_anthropic_usage(
Box::pin(crate::ai_free_tier_oss::meter_usage(
response.bytes_stream(),
db.clone(),
lease,
@@ -971,7 +971,7 @@ async fn proxy(
))
} else {
let bytes = response.bytes().await.map_err(to_anyhow)?;
crate::ai_free_tier_oss::record_anthropic_json_usage(db.clone(), lease, &bytes);
crate::ai_free_tier_oss::record_json_usage(db.clone(), lease, &bytes);
axum::body::Body::from(bytes)
};
return Ok((status_code, headers, body));
+2 -2
View File
@@ -44,10 +44,10 @@ pub async fn free_tier_copilot_config(_db: &DB, _email: &str) -> Result<Option<A
}
#[cfg(not(feature = "private"))]
pub fn record_anthropic_json_usage(_db: DB, _lease: FreeTierLease, _bytes: &[u8]) {}
pub fn record_json_usage(_db: DB, _lease: FreeTierLease, _bytes: &[u8]) {}
#[cfg(not(feature = "private"))]
pub fn meter_anthropic_usage<S>(
pub fn meter_usage<S>(
upstream: S,
_db: DB,
_lease: FreeTierLease,