Remix.run Logo
How we're saving 50k$ of Claude API every month(github.com)
3 points by FrancescoMassa 5 hours ago | 7 comments
FrancescoMassa 5 hours ago | parent | next [-]

Brick is a cheap & smart spatial router that plugged into claude code redirects the query to the best model in your pool. You can use it to save tokens, use other providers in claude code without changing models by hand or making your plans way longer in code time

danilovilhena 4 hours ago | parent | prev | next [-]

How does it deal with prompt caching? Do you have any resource for this, I'd like to check it out.

I've heard changing models messes up caching and costs more.

FrancescoMassa 4 hours ago | parent | next [-]

For sure that’s absolutely true because you’re switching context from a kV cache to another one. We introduced 2 algorythms for solving this : 1) sticky : switches model only when convenient 2) smartsqueeze : fast advanced compression for reingesting context

verdverm 4 hours ago | parent | prev [-]

If you switch models, you have no cache. There is no way to change this as they depend on sending the tokens through the weights and saving the computation results. Different model, different tokens, different weights, different calculation.

FrancescoMassa 4 hours ago | parent [-]

Actually yes because context is kept on kV cache

verdverm 3 hours ago | parent [-]

you cannot transfer KV cache from one model to another

BedVibe_Studios 4 hours ago | parent | prev [-]

[dead]