lightninglabs / aperture

⚡️L402 (Lightning HTTP 402) Reverse Proxy ⚡️
http://l402.tech/
MIT License
233 stars 58 forks source link

multi: extend the pricesrpc interface to pass in the full HTTP request context #99

Closed Roasbeef closed 1 year ago

Roasbeef commented 1 year ago

In this PR, we add the http_request_text to the GetPrice RPC call. This'll contain the fully serialized HTTP request, which'll permit the back end to check things like the set of headers or request body, which may be useful in more fine grained pricing functions.

One example is: when proxying requests to an LLM platform provider, the backed may want to charge more based on the length of the context/message and/or which model is being used.