Post
1/ Prompt caching If you're running the same prompt, OpenAI's API offers automatic context caching for generations over 1k tokens. Put the variable part of the prompt at the end of it - otherwise caching won't take effect. This can reduce costs by 50%. platform.openai.com/docs/guides...
2/ Batching Just like caching, you can reduce the costs by 50%, except you can do that by batching multiple generations at once. This API is asynchronous and can take up to 24 hours to finish running. This is a trade-off for complexity in your app. platform.openai.com/docs/api-re...
3/ Prompt optimization Reduce the amount of tokens by making your prompt shorter and more concise. You can even ask an LLM to do that for you. To verify, you can set up a simple prompt versioning system and run A/B tests to see if the results are still satisfactory.
0 reposts0 likes
This was quite a puzzle for me in sky-scout.app/waitlist as I want to make the app as cheap and as accessible as possible. After trying out a bunch of different models, I settled mainly on 4o-mini. Gemini Flash and Minstral results were rather mediocre.