curl https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/run/@cf/mistral/mistral-7b-instruct-v0.1 -H "Authorization: Bearer <cf_token>" -d "{\"messages\": [{\"role\": \"user\",\"content\": \"Write a python program to check if a number is even or odd.\"}],\"lora\": \"cf-public-magicoder\"}"
with my <account_id> and <cf_token>.
Tried some variants like @cf/mistral/mistral-7b-instruct-v0.1, @hf/mistral/mistral-7b-instruct-v0.2, and @cf/mistral/mistral-7b-instruct-v0.2-lora. None of them give expected response.
If I remove the lora term, aka
curl https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/run/@cf/mistral/mistral-7b-instruct-v0.1 -H "Authorization: Bearer <cf_token>" -d "{\"messages\": [{\"role\": \"user\",\"content\": \"Write a python program to check if a number is even or odd.\"}]}"
In my case, by digging into the parameters of the model I’m using (@cf/meta/llama-3.2-3b-instruct), I found out that the Workers AI docs are wrong in (at least) one detail, the top_p specs.
According to the (CF) docs its valid range is 0-2, but it actually is 0-1.
I was trying 1.05, which of course triggered Error: 3028: Unknown internal error.
Once I fixed the value, It worked just fine.
Recommendation: double-check the config/parameter specs.