alfin06/swegent-issues-filtered huggingface dataset:
Bump vllm version to v0.7.3 (Qwen2.5-VL vllm inference fixes)

### Reminder

- [x] I have read the above rules and searched the existing issues.

### System Info

- `llamafactory` version: 0.9.2.dev0
- Python version: 3.11.11
- PyTorch version: 2.5.1+cu124 (GPU)
- Transformers version: 4.49.0
- Datasets version: 3.2.0
- Accelerate version: 1.2.1
- PEFT version: 0.12.0
- TRL version: 0.9.6
- GPU type: NVIDIA H100 80GB HBM3
- GPU number: 1
- GPU memory: 79.11GB
- vLLM version: 0.7.2

### Reproduction

```text
python3.11 LLaMA-Factory/scripts/vllm_infer.py --model_name_or_path "Qwen/Qwen2.5-VL-7B-Instruct" \
                                               --dataset my_dataset \
                                               --dataset_dir /data/dataset \
                                               --template qwen2_vl  \
                                               --save_name /predicts/predictions.jsonl \
```

Error msg: `ValueError: Model architectures ['Qwen2_5_VLForConditionalGeneration'] failed to be inspected. Please check the logs for more details.`

### Others

VLLM [v0.7.3 release](https://github.com/vllm-project/vllm/releases/tag/v0.7.3) fixes Qwen2.5-VL inference. Would you consider updating?

Raw vllm=v0.7.3 inference fixes the bug.

Labels: solved
State: closed
types are incorrect for streaming tool call inputs

https://github.com/vercel/ai/blob/ffac5e5f564b670187256f9adb84a0095255e1f9/packages/ai/src/ui/ui-messages.ts#L190

When streaming tool calls, it seems like `input` can be undefined (when the tool call starts but before inputs actually start streaming in), but the types don't handle this case.

So if you do:
```
switch (toolPart.state) {
  case "input-streaming": {
    // this will crash when toolPart.input is undefined, but typescript doesn't complain
    const foo = toolPart.input.foo;
    ...
    break;
  }
  ...
}
```

Labels: bug, ai/ui
State: closed
`messages` property is different even on same useChat id

### Description

I recently migrated my llm chat app (Tanstack Start) from v4 to v5. I noticed that the `messages` property returned by `useChat` is different on client-side route change even though they have the same `id`.

### AI SDK Version

"@ai-sdk/azure": "^2.0.0-beta.6"
"@ai-sdk/react": "^2.0.0-beta.13"
"ai": "^5.0.0-beta.13"

Labels: documentation, ai/ui, ai/provider, support, provider/azure
State: closed
Accept `"type": ""` tool calls

### Description

The OpenAI Compatible provider currently has two layers to verify that every tool call has a `type` of `"function"`:
https://github.com/vercel/ai/blob/9e16bfddb83e2d0158deb67eeec3b9e07344631b/packages/openai-compatible/src/openai-compatible-chat-language-model.ts#L500-L505
https://github.com/vercel/ai/blob/9e16bfddb83e2d0158deb67eeec3b9e07344631b/packages/openai-compatible/src/openai-compatible-chat-language-model.ts#L700

But these checks are unnecessary and serve no purpose since the "function" is the only type of tool call OpenAI's ever declared. More importantly, they prevent me from using the OpenAI Compatible provider from connecting to Novita AI, a provider that sets the type of tool calls to `""` after the first one, like it's a delta. Novita isn't changing how their API works - they're confident that this "complies with OpenAI guidelines", and it makes some intuitive sense (it is in the delta section of the stream after all). To solve this, these checks will have to be removed.

### AI SDK Version

_No response_

Labels: feature, ai/provider, provider/openai-compatible
State: closed
智谱Embedding模型 提示向量化失败

### 📦 Platform

Self hosting Docker, Other

### 📦 Deploymenet mode

server db(lobe-chat-database image)

### 📌 Version

1.68.3

### 💻 Operating System

Other Linux

### 🌐 Browser

Chrome

### 🐛 Bug Description

对文件进行向量化时提示以下错误:

![Image](https://github.com/user-attachments/assets/1e43e463-361e-4128-95c1-d0626ff0c8d3)

日志报错:

![Image](https://github.com/user-attachments/assets/36185043-fd49-44c7-9a37-27a83e971d21)

![Image](https://github.com/user-attachments/assets/31fcbc89-e2fe-45ed-9b83-2e651a4105ee)

但是与此同时 Chat功能正常

![Image](https://github.com/user-attachments/assets/a5708918-8056-403e-86cc-4a503d0af292)

### 📷 Recurrence Steps

embedding模型环境变量配置

![Image](https://github.com/user-attachments/assets/1a42be49-ccb9-4e56-ac6f-cb0723a59ec4)


**!!!使用本地项目通用Dockerfile  构建镜像**

### 🚦 Expected Behavior

_No response_

### 📝 Additional Information

_No response_

Labels: released, unconfirm
State: closed
Get Web Search query to UI with OpenAI models and the web search tool

### Description

When using a model like o3 with the webSearchPreview tool and the reasoning summary is enabled, you can see the actual search query o3 writes.
It would be very helpful to get this info to the frontend so that it can be displayed to the user.

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
  model: "o3-2025-04-16",
  input: [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What will be added in the next version of the Vercel AI SDK",
        },
      ],
    },
  ],
  text: {
    "format": {
      "type": "text",
    },
  },
  reasoning: {
    "effort": "medium",
    "summary": "auto",
  },
  tools: [
    {
      "type": "web_search_preview",
      "user_location": {
        "type": "approximate",
      },
      "search_context_size": "medium",
    },
  ],
  streaming: true,
  store: true,
});

for await (const chunk of response) {
  console.log(JSON.stringify(chunk, null, 2));
}
```

Will print steps like this:
```json
{
  "type": "response.output_item.added",
  "sequence_number": 112,
  "output_index": 3,
  "item": {
    "id": "ws_68755c8903d8819c80181f01d8e7803f035a165df43f3ddd",
    "type": "web_search_call",
    "status": "in_progress"
  }
}
{
  "type": "response.web_search_call.in_progress",
  "sequence_number": 113,
  "output_index": 3,
  "item_id": "ws_68755c8903d8819c80181f01d8e7803f035a165df43f3ddd"
}
{
  "type": "response.web_search_call.searching",
  "sequence_number": 114,
  "output_index": 3,
  "item_id": "ws_68755c8903d8819c80181f01d8e7803f035a165df43f3ddd"
}
{
  "type": "response.web_search_call.completed",
  "sequence_number": 115,
  "output_index": 3,
  "item_id": "ws_68755c8903d8819c80181f01d8e7803f035a165df43f3ddd"
}
{
  "type": "response.output_item.done",
  "sequence_number": 116,
  "output_index": 3,
  "item": {
    "id": "ws_68755c8903d8819c80181f01d8e7803f035a165df43f3ddd",
    "type": "web_search_call",
    "status": "completed",
    "action": {
      "type": "search"
    }
  }
}
```

meaning the data is there, but when i replicate the same thing with the ai-sdk the `action` field gets lost.

I want to add that i call OpenAI through the ai-sdk like this:
```typescript

 const tools = {
  web_search_preview: openai.tools.webSearchPreview({
    searchContextSize: "medium",
  }),
};
  const result = streamText({
    model: openai.responses("o4-mini-2025-04-16"),
    providerOptions: {
      openai: {
        store: true,
        reasoningSummary: "detailed",
      },
    },
    tools,
    messages: convertToModelMessages(messages),
  });
```

### AI SDK Version

- ai: 5.0.0-beta.18
- @ai-sdk/openai 2.0.0-beta.7

Labels: bug, ai/provider, provider/openai
State: closed
gemini 函数调用经常出错

### 📦 Platform

Self hosting Docker

### 📦 Deploymenet mode

server db(lobe-chat-database image)

### 📌 Version

v1.77.3

### 💻 Operating System

Windows

### 🌐 Browser

Chrome

### 🐛 Bug Description

{
  "error": {
    "code": 400,
    "type": "",
    "param": "",
    "message": "Please ensure that function call turn comes immediately after a user turn or after a function response turn. (request id: 202504050808476211941993G1b22XE)"
  },

  "provider": "mynewapi"
}

### 📷 Recurrence Steps

_No response_

### 🚦 Expected Behavior

_No response_

### 📝 Additional Information

_No response_

Labels: Inactive, released, unconfirm
State: closed
Support for Anthropic Code execution tool

### Description

https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool

### AI SDK Version

_No response_

Labels: feature, ai/provider, provider/anthropic
State: closed
grok 用不了

### 📦 Platform

Self hosting Docker

### 📦 Deploymenet mode

client db (lobe-chat image)

### 📌 Version

laster

### 💻 Operating System

Ubuntu

### 🌐 Browser

Chrome

### 🐛 Bug Description

请求api就报错：{
  "error": "Argument not supported: stream_options",
  "endpoint": "https://api-pr****xy.me/xai/v1",
  "provider": "xai"
}

### 📷 Recurrence Steps

_No response_

### 🚦 Expected Behavior

_No response_

### 📝 Additional Information

_No response_

Labels: released, unconfirm
State: closed
[Request] grok3的API出来了，期待添加支持

### 🥰 需求描述

希望有grok3API的支持

### 🧐 解决方案

添加grok3API

### 📝 补充信息

_No response_

Labels: released
State: closed
`getToolName` doesn't handle hyphens in tool names

https://github.com/vercel/ai/blob/e39ee60dab6cd80110aeff86f5ed770b7e5e98ce/packages/ai/src/ui/ui-messages.ts#L243

This only returns the text between the first and second hyphens, but it should return everything after the first hyphen.

Labels: bug, ai/ui
State: closed
Streaming not working on first load / hard refresh (fixes after fast-refresh) on local dev

### Description

Text Streaming is not working on first page load / hard refresh on nextjs in development mode.
If I send a message asking for a long response after a hard refresh, the network streaming tab shows the chunks coming in, but the `messages` array from useChat only updates with the first step-start and state: streaming, and then at the very end with the final message.

If I leave the page open and cause an update with Fast Refresh, then streaming works properly until I reload the page.

If the model makes tool calls before responding, the first tool call gets parsed in the messages array with "input-streaming". Then streaming stops being parsed, and the next update to `messages` contains the full tool call, it's output, any other tool calls and the final text response with state: "done".

Streaming works as expected after a hot/fast reload (If I add a console.log and then save)

Tested on Chrome, Safari, Arc

### AI SDK Version

ai-sdk/react: 2.0.0-beta.22
ai: 5.0.0-beta.22
next: 15.3.4

Labels: ai/ui, support
State: closed
Goolge Image Model not supported v5

### Description

trying to use  `google.imageModel(imagen-3.0-generate-001) or imagen 4`,   got error saying model not supported in v5


### AI SDK Version

v5

Labels: feature, ai/provider, provider/google
State: closed
`readUIMessageStream` should throw an error when it encounters an `error` UI stream part

### Description

Currently there is no way to detect errors that happened during streaming when using `readUIMessageStream`, the message generator will just stop yielding new messages

Instead it should throw an error when it encounters an error stream part, for example it should throw an error when the UIStream contains something like this:

```
{
  "type": "error",
  "errorText": "Invalid input for tool strReplaceEditor: Type validation failed: Value: {\"command\":\"str_replace\",\"path\":\"essentials/images.md\",\"old_str\":\"<img\\n  style={{ borderRadius: '0.5rem' }}\\n  src=\\\"https://uploads.fumabase.com/Gui86K8XoAAZRb_.jpeg\\\"\\n/>\\n\\n\",\"new_str\":\"\"}.\nError message: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"file_text\"\n    ],\n    \"message\": \"Invalid input: expected string, received undefined\"\n  },\n  {\n    \"expected\": \"number\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"insert_line\"\n    ],\n    \"message\": \"Invalid input: expected number, received undefined\"\n  },\n  {\n    \"expected\": \"array\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"view_range\"\n    ],\n    \"message\": \"Invalid input: expected array, received undefined\"\n  }\n]"
}


```

### AI SDK Version

_No response_

Labels: feature, ai/core, ai/ui
State: closed
There are issues with the support for the Gemma 3 1B model.        4o

### Reminder

- [x] I have read the above rules and searched the existing issues.

### System Info

- `llamafactory` version: 0.9.3.dev0
- Platform: Linux-6.8.0-55-generic-x86_64-with-glibc2.39
- Python version: 3.12.9
- PyTorch version: 2.5.1+cu124 (GPU)
- Transformers version: 4.50.0
- Datasets version: 3.3.2
- Accelerate version: 1.4.0
- PEFT version: 0.12.0
- TRL version: 0.9.6
- GPU type: NVIDIA A100-SXM4-80GB
- GPU number: 8
- GPU memory: 79.25GB
- DeepSpeed version: 0.16.4
- vLLM version: 0.7.3
- Git commit: 76cb0a9fc305ee42e26472d5afe219caffc36bd7

### Reproduction

Referring to Issues #7385, #7325, #7320, and #7291, several users have reported the problem `Processor was not found, please check and update your processor config` when training with Gemma 3. After inspecting the source code, I found that in [this line](https://github.com/hiyouga/LLaMA-Factory/blob/165d3ed084b093accb2aa1d1209d1903183245e1/src/llamafactory/model/loader.py#L96)https://github.com/hiyouga/LLaMA-Factory/blob/165d3ed084b093accb2aa1d1209d1903183245e1/src/llamafactory/model/loader.py#L96, when loading the processor, Gemma 1B fails to find the processor because it's a pure text model. This then causes an error later during the `process_messages` function call [here](https://github.com/hiyouga/LLaMA-Factory/blob/ef5f1c1def3da62ee2d5e6ba933f9d7d6aab4340/src/llamafactory/data/mm_plugin.py#L401)https://github.com/hiyouga/LLaMA-Factory/blob/ef5f1c1def3da62ee2d5e6ba933f9d7d6aab4340/src/llamafactory/data/mm_plugin.py#L401, since this `process_messages` function seems to be written with a multimodal architecture in mind. It might be necessary to add some additional conditional handling specifically for Gemma 1 to address this.

### Others

_No response_

Labels: solved
State: closed
Add support for vLLM-Ascend

### Reminder

- [x] I have read the above rules and searched the existing issues.

### Description

I am about to add support for VLLM-ascend.
Interested developers can work together to add support for vllm-ascend.

### Pull Request

_No response_

Labels: solved, npu
State: closed
`shouldResubmitMessages` throws if `messages` is mutated

### Description

Calling `messages.pop()` when using `useChat` or any of the providers throws `TypeError: Cannot read property of undefined` when re-submitting the message.

### AI SDK Version

- ai: beta25

Labels: ai/core, support
State: closed
`convertToModelMessages()` still required in v5 despite documentation stating it's no longer needed

## Description

After upgrading to AI SDK v5, I'm encountering an error when trying to use `streamText` without `convertToModelMessages()`, [even though the documentation explicitly states](https://v5.ai-sdk.dev/docs/reference/ai-sdk-ui/convert-to-model-messages#converttomodelmessages:~:text=The%20convertToModelMessages%20function%20is%20no%20longer%20required.%20The%20AI%20SDK%20now%20automatically%20converts%20the%20incoming%20messages%20to%20the%20ModelMessage%20format.):

> The `convertToModelMessages` function is no longer required. The AI SDK now automatically converts the incoming messages to the `ModelMessage` format.

When attempting to use the API without `convertToModelMessages()`:

```plaintext
AI_InvalidPromptError: Invalid prompt: The messages must be a ModelMessage[]. If you have passed a UIMessage[], you can use convertToModelMessages to convert them.
    at (node_modules/.pnpm/ai@5.0.0-beta.25_zod@4.0.5/node_modules/ai/dist/index.mjs:1329:0)
    at (node_modules/.pnpm/ai@5.0.0-beta.25_zod@4.0.5/node_modules/ai/dist/index.mjs:4352:0)
    at (node_modules/.pnpm/ai@5.0.0-beta.25_zod@4.0.5/node_modules/ai/dist/index.mjs:4719:0)
    at (node_modules/.pnpm/ai@5.0.0-beta.25_zod@4.0.5/node_modules/ai/dist/index.mjs:1493:0) {
  name: 'AI_InvalidPromptError',
  cause:  AI_TypeValidationError: Type validation failed: Value: [{"role":"system","parts":[{
  ...
```

### Code Example

Client-side (using `useChat`):

```ts
const useChatResult = useChat({
  transport: new DefaultChatTransport({ api: '/api/chat' }),
  messages: [
    {
      role: 'system',
      parts: [{ type: 'text', text: 'You are a helpful assistant.' }],
      id: 'system-prompt',
    },
    // ... other messages
  ] as UIMessage[],
});
```

Server-side route handler (following v5 docs):

```ts
import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

export async function POST(req: Request) {
  const { messages } = await req.json();

  const result = streamText({
    model: anthropic('claude-3-5-sonnet-20241022'),
    system: 'You are a helpful assistant.',
    messages, // This throws the error
  });

  return result.toUIMessageStreamResponse();
}
```

### Working Solution

The code only works when I explicitly use `convertToModelMessages()`:

```ts
import { convertToModelMessages, streamText } from 'ai';

export async function POST(req: Request) {
  const { messages } = await req.json();

  const modelMessages = convertToModelMessages(messages);

  const result = streamText({
    model: anthropic('claude-3-5-sonnet-20241022'),
    system: 'You are a helpful assistant.',
    messages: modelMessages,
  });

  return result.toUIMessageStreamResponse();
}
```

### Expected Behavior

According to the v5 documentation, the SDK should automatically convert `UIMessage[]` to `ModelMessage[]` format without requiring manual conversion.


## AI SDK Version

- ai: 5.0.0-beta.25
- @ai-sdk/anthropic: 2.0.0-beta.8
- @ai-sdk/react: 2.0.0-beta.25

Labels: ai/provider, support, provider/anthropic
State: closed
Add Gemini 2.5 Flash Lite GA support

### Description

Gemini 2.5 Flash Lite went GA on July 22, 2025 - https://developers.googleblog.com/en/gemini-25-flash-lite-is-now-stable-and-generally-available/ .

It would be good to make this model available to consumers of the API.

### AI SDK Version

_No response_

Labels: feature, ai/provider, provider/google
State: closed
💽 Explore PGVector and Supabase

We've been having some prod issues running Weaviate. We should look into PG Vector since it also has a free open source offering and also has a managed offering through Supabase 

State: closed
qwen2.5-Omni support

### Reminder

- [x] I have read the above rules and searched the existing issues.

### Description

any plan of qwen2.5-Omni support

### Pull Request

_No response_

Labels: solved
State: closed
使用vllm_infer一次性推理多个样本会报错

### Reminder

- [x] I have read the above rules and searched the existing issues.

### System Info

会出现`OSError: [Errno 24] Too many open files:`

但是如果之前把PIL的Image.open关掉，在最后LLM函数调用时出现

`[rank0]: ValueError: seek of closed file`的错误

### Reproduction

```text
Put your message here.
```


### Others

_No response_

Labels: solved
State: closed
[Request] gpt-4o-search-preview联网搜索模型接入

### 🥰 需求描述

```python
from openai import OpenAI

client = OpenAI(
    # defaults to os.environ.get("OPENAI_API_KEY")
    api_key="<api_key>",
    base_url="https://api.chatanywhere.tech/v1" # 我这里用的转接，官方也一样
)

response = client.chat.completions.create(
    model="gpt-4o-search-preview",
    messages=[
        {"role": "system", "content": "you are chatgpt"},
        {"role": "user", "content": "explain Zero Moment Point (ZMP) "}
    ],
#temperature=0.1,  # 这一行需要被注释
)
result = response.choices[0].message.content
print(result)
```
当使用gpt-4o-search-preview这一类的search api时，不能够传入temperature参数，否则会报错


### 🧐 解决方案

但是前端页面中没有完全不传入temperature参数的选项，是否可以通过更新或者插件实现这一功能？

### 📝 补充信息

_No response_

Labels: released
State: closed
Support FileId in OpenAI responses file and image messages

### Description

The [Open AI Responses API](https://platform.openai.com/docs/api-reference/responses/create) supports referencing images by OpenAI File.id as well as URL / Base64. It would be ideal to be able to optionally pass ths OpenAI FileID in the message Part when working with large file (OpenAI limits URL images to 10 MB)

### AI SDK Version

@ai-sdk/openai - 1.3.22

Labels: feature, ai/provider, provider/openai
State: closed
Inaccurate token count

### What happened?

I tried to use Gemini CLI with the flash image preview model (which didnt work). However, when I closed the app, I noticed it said that I had used tokens:  

<img width="412" height="313" alt="Image" src="https://github.com/user-attachments/assets/0144f56f-4497-414b-9279-944083e8296b" />

### What did you expect to happen?

I would expect 0 billed / used tokens.

### Client information

<details>
<summary>Client Information</summary>

Run `gemini` to enter the interactive CLI, then run the `/about` command.

```console
> /about
│ About Gemini CLI                                                             │
│                                                                              │
│ CLI Version               0.2.2                                              │
│ Git Commit                32204dca                                           │
│ Model                     gemini-2.5-flash-image-preview                     │
│ Sandbox                   no sandbox                                         │
│ OS                        darwin                                             │
│ Auth Method               OAuth        
```

</details>

### Login information

Vertex auth

### Anything else we need to know?

_No response_

State: closed
`messages.push(...result.response.messages)` results in unsupported message structure if tool does not return a value

### Description

```
Uncaught AI_InvalidPromptError: Invalid prompt: The messages must be a ModelMessage[]. If you have passed a UIMessage[], you can use convertToModelMessages to convert them.
    at standardizePrompt (../../node_modules/ai/src/prompt/standardize-prompt.ts:72:6)
    at async generateText (../../node_modules/ai/src/generate-text/generate-text.ts:238:4)
    at async execute [as execute] (../../convex/agent.ts:235:17)
    at async handler (../convex/demo_actions.ts:66:6)
```

With simply:
```ts
messages.push(...result.response.messages)
```

The message array that was used:

```json
[
  {
    "role": "system",
    "content": "Based on the transcribed audio from the user, use the tools to update the medicine plan and/or dietary restrictions if the message includes an update. If the message includes both, update both. If the message does not include an update, do not use the tools."
  },
  {
    "role": "user",
    "content": "no sugar, no added salt, 25 milligrams ibuprofen 8am and 8pm daily, atenolol 25 milligram every morning"
  },
  {
    "role": "assistant",
    "content": [
      {
        "type": "text",
        "text": "I'll update both the dietary restrictions and medicine plan based on your instructions."
      },
      {
        "type": "tool-call",
        "toolCallId": "toolu_013J1mLwrvby87F9nyq3Q8nk",
        "toolName": "updateDietaryRestrictions",
        "input": {
          "dietaryRestrictions": [
            {
              "restriction": "no",
              "nutrient": "sugar"
            },
            {
              "restriction": "no",
              "nutrient": "added salt"
            }
          ]
        }
      },
      {
        "type": "tool-call",
        "toolCallId": "toolu_01F84VZxhew9ku2CiDfkhG8E",
        "toolName": "updateMedicinePlan",
        "input": {
          "medicines": [
            {
              "name": "ibuprofen",
              "dosage": "25mg",
              "schedule": "8am and 8pm daily"
            },
            {
              "name": "atenolol",
              "dosage": "25mg",
              "schedule": "every morning"
            }
          ]
        }
      }
    ]
  },
  {
    "role": "tool",
    "content": [
      {
        "type": "tool-result",
        "toolCallId": "toolu_013J1mLwrvby87F9nyq3Q8nk",
        "toolName": "updateDietaryRestrictions",
        "output": {
          "type": "json"
        }
      },
      {
        "type": "tool-result",
        "toolCallId": "toolu_01F84VZxhew9ku2CiDfkhG8E",
        "toolName": "updateMedicinePlan",
        "output": {
          "type": "json"
        }
      }
    ]
  }
]
```

I'm not sure why this is breaking it, as the error message is horribly ambiguous

### AI SDK Version

`ai: "5.0.0-beta.21"`

Labels: bug, ai/core
State: closed