Support Fireworks AI endpoint
Fireworks.ai clients previously worked using an openai-type provider, but have since stopped working with a 400 Bad Request error:
Request failed: {"error":{"object":"error","type":"invalid_request_error","message":"Extra inputs are not permitted, field: 'stream_options'"}}
Is it possible to:
- prevent
stream_optionsfrom being sent by setting a field in options? or - can we have a specific provider for FireworksAI that doesn't set a value for
stream_options?
Fireworks generally has excellent token rates, it would be great to be able to use BAML with them.
oh yes for fireworks, can you try the "ollama" provider?
that one doesn't include "stream_options"
if that works, then I'll update the docs
Great idea! I tried it, but got {"error":"unauthorized"}. Looks like ollama doesn't forward along the value for api_key.
You can set it manually using headers { "Authorization" "Bearer api_key" } but because string concatenation isn't supported there, you'd have to either save the API key in the .baml file itself, or use an environment variable with Bearer prepended to it.
yes our current workaround is to add the header with an environment variable like that, we'll see if we just add a quick provider for fireworks that works out-of-the-box in a cleaner way.
@arunbahl to unblock you i think we can have an env variable thats something like FIREWORKS_API_KEY="Bearer <key>"
But we'll look into a way to prevent and likely remove teh stream_options parameter
Oops, just realized you noted that already.
Makes sense and the workaround is great for now. Thanks for your responsiveness and all your work on this project, we're fans :)