You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(experimental.generate): embeddings support for plugins #62794
An "embedding" model type next to "chat" | "decision" | "image".
Two wire formats: OpenAI-compatible POST /embeddings and Gemini batchEmbedContents.
purpose maps to Gemini's taskType and is ignored by OpenAI-compatible providers
Implementation parallels what was done for decisions API
I have a locally working prototype tested end to end through a plugin against a local OpenAI-compatible server running Qwen3-Embedding-8B
Surface area: ~580 mostly additive lines plus regenerated openapi.json and client code. ~470 in packages/ai, a few lines in every other package mirroring the decisions entry
I'd be happy to open a PR if this shape is acceptable.
Thanks for the detailed proposal, @benn-herrera! This asks for a generate.embed method on the experimental.generate API, with a new embedding model type and OpenAI-compatible and Gemini wire formats, so plugins can build memory or RAG features on top of OpenCode's configured providers.
Right now v2 has no embedding support. Plugins get generate.text, generate.image and generate.decisions, and models.dev model types are limited to chat, decision and image. That means a plugin can't do this through OpenCode's providers today. Maintainers will look at whether this shape fits; since the API is experimental, it's worth waiting for their feedback on the design before opening the PR.
Activity
opencodejr commentedon Nov 8, 2026
Thanks for the detailed proposal, @benn-herrera! This asks for a
generate.embedmethod on theexperimental.generateAPI, with a newembeddingmodel type and OpenAI-compatible and Gemini wire formats, so plugins can build memory or RAG features on top of OpenCode's configured providers.Right now v2 has no embedding support. Plugins get
generate.text,generate.imageandgenerate.decisions, and models.dev model types are limited tochat,decisionandimage. That means a plugin can't do this through OpenCode's providers today. Maintainers will look at whether this shape fits; since the API is experimental, it's worth waiting for their feedback on the design before opening the PR.Related issues:
benn-herrera commentedon Nov 11, 2026
Just saw the on-point PRs into dev - outstanding, thank you!
Looking forward to putting it to good use.