File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
docs/my-website/docs/providers Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -2758,6 +2758,44 @@ curl http://localhost:4000/v1/fine_tuning/jobs \
2758
2758
</Tabs >
2759
2759
2760
2760
2761
+ ## Labels
2762
+
2763
+
2764
+ Google enables you to add custom metadata to its ` generateContent ` and ` streamGenerateContent ` calls.
2765
+ This mechanism is useful in Vertex AI because it allows costs and usage tracking over multiple
2766
+ different applications or users.
2767
+
2768
+
2769
+ ### Usage
2770
+
2771
+ You can use that feature through LiteLLM by sending ` labels ` or ` metadata ` field in your requests.
2772
+
2773
+ If the client sets the ` labels ` field in the request to the LiteLLM,
2774
+ the LiteLLM will pass the ` labels ` field to the Vertex AI backend.
2775
+
2776
+ If the client sets the ` metadata ` field in the request to the LiteLLM and the ` labels ` field is not set,
2777
+ the LiteLLM will create the ` labels ` field filled with ` metadata ` key/value pairs for all string values and
2778
+ pass it to the Vertex AI backend.
2779
+
2780
+
2781
+ Here is an example JSON request demonstrating the labels usage:
2782
+
2783
+ ``` json
2784
+ {
2785
+ "model" : " gemini-2.0-flash-lite" ,
2786
+ "messages" : [
2787
+ { "role" : " user" , "content" : " respond in 20 words. who are you?" }
2788
+ ],
2789
+ "labels" : {
2790
+ "client_app" : " acme_comp_financial_app" ,
2791
+ "department" : " finance" ,
2792
+ "project" : " acme_ai"
2793
+ }
2794
+ }
2795
+ ```
2796
+
2797
+
2798
+
2761
2799
## Extra
2762
2800
2763
2801
### Using ` GOOGLE_APPLICATION_CREDENTIALS `
You can’t perform that action at this time.
0 commit comments