-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from bricks-cloud/v0.0.9
[v0.0.9] Start providing metrics regarding number of api calls and associated costs
- Loading branch information
Showing
12 changed files
with
508 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package event | ||
|
||
import "github.com/bricks-cloud/bricksllm/internal/provider" | ||
|
||
type Event struct { | ||
Id string | ||
CreatedAt int64 | ||
Tags []string | ||
KeyId string | ||
CostInUsd float64 | ||
Provider provider.Provider | ||
Model string | ||
Status int | ||
PromptTokenCount int | ||
CompletionTokenCount int | ||
LatencyInMs int | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package event | ||
|
||
type DataPoint struct { | ||
TimeStamp int64 `json:"timeStamp"` | ||
NumberOfRequests int64 `json:"numberOfRequests"` | ||
CostInUsd float64 `json:"costInUsd"` | ||
LatencyInMs int `json:"latencyInMs"` | ||
PromptTokenCount int `json:"promptTokenCount"` | ||
CompletionTokenCount int `json:"completionTokenCount"` | ||
SuccessCouunt int `json:"successCount"` | ||
} | ||
|
||
type ReportingResponse struct { | ||
DataPoints []*DataPoint `json:"dataPoints"` | ||
LatencyInMsMedian float64 `json:"latencyInMsMedian"` | ||
LatencyInMs99th float64 `json:"latencyInMs99th"` | ||
} | ||
|
||
type ReportingRequest struct { | ||
KeyIds []string `json:"keyIds"` | ||
Tags []string `json:"tags"` | ||
Start int64 `json:"start"` | ||
End int64 `json:"end"` | ||
Increment int64 `json:"increment"` | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package provider | ||
|
||
type Provider string | ||
|
||
const ( | ||
OpenAiProvider Provider = "openai" | ||
) |
This file contains 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
This file contains 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
Oops, something went wrong.