Have you considered using embedding models? #1708

Closed
opened 2026-02-16 17:32:16 -05:00 by yindo · 3 comments
Owner

Originally created by @arturo-source on GitHub (Sep 13, 2025).

Originally assigned to: @thdxr on GitHub.

Proposal: Embedding models are cheaper and faster than LLMs. I thought that opencode could first ask the embedding model which part of the code responds better to the prompt, and then send these pieces of code to the LLM.

Drawback: The only limitation is that you have to first index the whole codebase, you can either send the entire files or use the LSP to get smaller code blocks. Then, save the vectors into a database, and you are good to go, you can ask first the embedding model which parts of the code fit better.

Options: There are some embedding models that can be run locally, so you might not depend on external providers, but also there are good embedding models from google or openai.

Maybe you already do that, but I haven't seen anything quick-reviewing the code, or maybe you have already considered that and it was not such a good idea, Thanks for the incredible project!

Originally created by @arturo-source on GitHub (Sep 13, 2025). Originally assigned to: @thdxr on GitHub. **Proposal**: Embedding models are cheaper and faster than LLMs. I thought that opencode could first ask the embedding model which part of the code responds better to the prompt, and then send these pieces of code to the LLM. **Drawback**: The only limitation is that you have to first index the whole codebase, you can either send the entire files or use the LSP to get smaller code blocks. Then, save the vectors into a database, and you are good to go, you can ask first the embedding model which parts of the code fit better. **Options**: There are some embedding models that can be run locally, so you might not depend on external providers, but also there are good embedding models from google or openai. Maybe you already do that, but I haven't seen anything quick-reviewing the code, or maybe you have already considered that and it was not such a good idea, Thanks for the incredible project!
yindo closed this issue 2026-02-16 17:32:16 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 13, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2108: Discusses RAG features that "index the whole codebase with embedding LLM" and repository mapping, which is very similar to your proposal for using embedding models to index and retrieve relevant code sections

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 13, 2025): This issue might be a duplicate of existing issues. Please check: - #2108: Discusses RAG features that "index the whole codebase with embedding LLM" and repository mapping, which is very similar to your proposal for using embedding models to index and retrieve relevant code sections Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@K0IN commented on GitHub (Dec 28, 2025):

Hei even if you don't implement this, could someone explain, how the indexing works rn and why it is not needed to (schematic) fast find relevant text?

@K0IN commented on GitHub (Dec 28, 2025): Hei even if you don't implement this, could someone explain, how the indexing works rn and why it is not needed to (schematic) fast find relevant text?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1708