Switching LLM Providers Without Rewriting Code
Kept switching between OpenAI and Anthropic APIs for different projects. Got annoying having to change imports and API calls each time.
# Instead of this mess
if provider == "openai":
from openai import OpenAI
client = OpenAI(api_key=key)
elif provider == "anthropic":
from anthropic import Anthropic
client = Anthropic(api_key=key)
# Just this
from llmswap import LLMSwap
llm = LLMSwap() # Auto-detects from env vars
Built llmswap to solve this. Now I can switch providers just by changing environment variables.