Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Proxy - Add Spend tracking logs #1498

Merged
merged 10 commits into from
Jan 18, 2024
Merged

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Jan 18, 2024

The following fields get logged

model LiteLLM_SpendLogs {
  request_id          String @unique
  api_key             String  @default ("")
  call_type           String
  spend               Float    @default(0.0)
  startTime           DateTime // Assuming start_time is a DateTime field
  endTime             DateTime // Assuming end_time is a DateTime field
  model               String   @default("")
  user                String   @default("")
  modelParameters     Json     @default("{}")// Assuming optional_params is a JSON field
  messages            Json     @default("[]")
  response            Json     @default("{}")
  usage               Json     @default("{}")
  metadata            Json     @default("{}")
  cache_hit           String   @default("")
}
Screenshot 2024-01-18 at 1 18 38 PM

Copy link

railway-app bot commented Jan 18, 2024

This PR is being deployed to Railway 🚅

litellm: ◻️ REMOVED

Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 18, 2024 9:41pm

@ishaan-jaff
Copy link
Contributor Author

ishaan-jaff commented Jan 18, 2024

Remaining:

  • Add e2e testing for writing costs for /chat/completions (non-stream), /chat/completions (stream), /embeddings
  • Add support for dynamoDB cost tracking

@ishaan-jaff
Copy link
Contributor Author

update - we need to have api_key be a column !

@ishaan-jaff
Copy link
Contributor Author

will merge after this passes testing

@ishaan-jaff ishaan-jaff merged commit a262678 into main Jan 18, 2024
7 checks passed
@krrishdholakia krrishdholakia deleted the litellm_spend_tracking_logs branch January 18, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant