Unknown internal error for LoRA adapters

For Workes & Pages, what is the name of the domain?

Not applicable

What is the error number?

3028

What is the error message?

{“errors”:[{“message”:“AiError: AiError: Unknown internal error”,“code”:3028}],“success”:false,“result”:{},“messages”:}

What is the issue or error you’re encountering

While applying LoRA for workers AI (following the public adapter tutorial at Public LoRA adapters · Cloudflare Workers AI docs ), I get the error. It is the same when I upload my LoRA myself.

What are the steps to reproduce the issue?

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.\"}]}"

and the response is expected.

It is the same while using Workers AI SDK and Workers page.

A post was split to a new topic: Unknown LoRA question

I’m also having this problem, if I change stream: true then I get no error code, but also no content:

< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Content-Type: text/event-stream
<
data: [DONE]

Same here. I tried curl and workers api but no its not working

bump, same issue with Mistral-7b-instruct-v0.2-lora, adapter successfully uploaded. Would love to get this up & running.

Same issue here with @cf/llava-hf/llava-1.5-7b-hf.

My code:

const formData = await request.formData();
const file = formData.get('file');
const blob = await file.arrayBuffer();

const caption = await env.AI.run(
  "@cf/llava-hf/llava-1.5-7b-hf",
  {
    image: [...new Uint8Array(blob)],
    prompt: "Generate a caption for this image",
    max_tokens: 512
  }
);

Error: 3028: Unknown internal error

Apparently this is a quite generic error.

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.