M
Mastraβ€’4d ago
Nic

Mistra embeds images when remote URLs are supported

According to Grok's documentation, it supports remote image urls as input. Mastra keeps embedding it as Base64 though. In my opinion this behavior should be changeable as it unnecessarily fills memory with megabytes of data. I use the latest v1.0.0 version. Grok Docs: https://docs.x.ai/docs/guides/image-understanding#constructing-the-message-body---difference-from-chat
Image Understanding | xAI
Guide on using image understanding with vision models
7 Replies
_roamin_
_roamin_β€’4d ago
Hey @Nic ! Which model provider package are you using? Are you using Mastra's model provider like this? Or another provider?
new Agent({
model: 'xai/grok-2'
})
new Agent({
model: 'xai/grok-2'
})
I believe the @ai-sdk/xai provider supports images passed as urls πŸ€”
Nic
NicOPβ€’3d ago
I am using Grok through OpenRouter: openrouter("x-ai/grok-4-fast") According to their documentation, they also support image URLs https://openrouter.ai/docs/guides/overview/multimodal/images#using-image-urls
Mastra Triager
Mastra Triagerβ€’3d ago
πŸ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10858 πŸ” If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly. πŸ™ Thank you for helping us improve Mastra!
Abhi Aiyer
Abhi Aiyerβ€’3d ago
The thing to check is if open router aisdk provider supportsImageUrls I don’t think it does Confirmed with open router that they do not support this flag yet I let their team know
Abhi Aiyer
Abhi Aiyerβ€’3d ago
GitHub
feat: add supportsImageUrls property by yogasanas Β· Pull Request #...
Description Adds supportsImageUrls = true property to both OpenRouterChatLanguageModel and OpenRouterCompletionLanguageModel classes, Changes: Added readonly supportsImageUrls = true to both model...
Abhi Aiyer
Abhi Aiyerβ€’3d ago
1.4.0
Nic
NicOPβ€’3d ago
That was quick. Works perfectly now πŸ™‚

Did you find this page helpful?