I kept running into the same problem: every time I wanted to try a different LLM provider, I had to rewrite large parts of my code. Different SDKs, different APIs, different response formats. It slowed down experiments and made simple comparisons painful.
So I ended up building a small abstraction layer that lets me switch between providers without touching the rest of the app. One interface, multiple backends.
In this post, I explain:
the exact problem I kept hitting
what design choices worked and what didn’t
how I structured the abstraction
and the trade-offs of this approach
If you’ve ever wanted to compare models or avoid vendor lock-in, this might be useful:
1 comment
[ 2.7 ms ] story [ 14.8 ms ] threadSo I ended up building a small abstraction layer that lets me switch between providers without touching the rest of the app. One interface, multiple backends.
In this post, I explain:
the exact problem I kept hitting
what design choices worked and what didn’t
how I structured the abstraction
and the trade-offs of this approach
If you’ve ever wanted to compare models or avoid vendor lock-in, this might be useful:
https://dev.to/chief_yaml_officer/how-i-stopped-rewriting-my...
Source: https://github.com/Nayjest/lm-proxy