-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Description
Image models are some of the most cost and time expensive models available on the market currently.
The support of native middleware on image models would allow for semantic caching of image prompts.
Our immediate use case however, is the introduction of consistent safety guardrails across multiple model providers. Image generation models can pose a large organisational reputational risk due to reproductions of copyrighted works, or generation of explicit content.
Currently we're prefixing and suffixing AI sdk calls with our safety system for prompt analysis, prompt rewrite, and safety checking. However, native middleware support would be an excellent addition.
I'm more than happy to create a PR replicating the implementations from LanguageModels and EmbeddingModels, but am interested in if this would align with direction of the project.
AI SDK Version
No response
Code of Conduct
- I agree to follow this project's Code of Conduct