Summary
Add a backend endpoint for embedding text using LiteLLM to support server-side embedding operations.
Background
Per docs/gitnexus-frontend-assessment.md, the architecture should support:
- Developer-local setups (Ollama, in-browser)
- Hosted deployments (Azure OpenAI) routed through LiteLLM
- Embeddings as a configurable provider, not architecture coupling
The frontend now has a configurable embedding provider system (frontend/src/core/embeddings/providers/). The backend needs complementary endpoints.
Requirements
Endpoint: POST /api/vector/embedding
Request:
{
"input": ["text1", "text2", ...] | "single text",
"model": "optional-model-override"
}
Response:
{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.1, 0.2, ...] },
...
],
"model": "model-used",
"usage": { "prompt_tokens": 10, "total_tokens": 10 }
}
Implementation Notes
- Use LiteLLM for routing to configured embedding provider
- Support environment-based configuration (LITELLM_EMBEDDING_MODEL, AZURE_OPENAI_*, etc.)
- Follow OpenAI-compatible response format
- Add to
src/codenav/server/ router
Configuration
- Environment variables for provider selection
- Support Azure OpenAI, OpenAI, Ollama through LiteLLM proxy
- Document in README or .env.example
Related
- Frontend providers:
frontend/src/core/embeddings/providers/
- API contract draft:
docs/gitnexus-frontend-assessment.md section 11.3
- Session notes:
docs/sessions/SESSION_20_SIGMA3_FRONTEND_REWRITE.md
Summary
Add a backend endpoint for embedding text using LiteLLM to support server-side embedding operations.
Background
Per
docs/gitnexus-frontend-assessment.md, the architecture should support:The frontend now has a configurable embedding provider system (
frontend/src/core/embeddings/providers/). The backend needs complementary endpoints.Requirements
Endpoint: POST /api/vector/embedding
Implementation Notes
src/codenav/server/routerConfiguration
Related
frontend/src/core/embeddings/providers/docs/gitnexus-frontend-assessment.mdsection 11.3docs/sessions/SESSION_20_SIGMA3_FRONTEND_REWRITE.md