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

pricesrpc: add additional request context to GetPriceRequest #97

Open
Roasbeef opened this issue May 31, 2023 · 1 comment
Open

pricesrpc: add additional request context to GetPriceRequest #97

Roasbeef opened this issue May 31, 2023 · 1 comment

Comments

@Roasbeef
Copy link
Member

Right now we only pass along the path of the request to the backend: https://github.com/lightninglabs/aperture/blob/master/pricesrpc/rpc.proto#L12

This is useful or pricing distinct calls to diff paths, but isn't as useful for more advanced use cases. One example is proxying access to an LLM, but scaling the pricing per query, based on things like the chosen model, the context size, etc, etc. All information that will be sent along with the rest as JSON encoded body params.

We should pass along all/some of the other request level context: https://pkg.go.dev/net/http#Request

@Roasbeef
Copy link
Member Author

Relevant context:

aperture/proxy/proxy.go

Lines 158 to 161 in 9b85f8b

price, err := target.pricer.GetPrice(
r.Context(), r.URL.Path,
)
if err != nil {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant