Skip to content

Feature Request: Add serve mode compatible with OpenAI Embeddings API #127

@isaac47

Description

@isaac47

Description:

Feature Request: Serve embed-anything with OpenAI-compatible API

Description:
It would be great to have a serve mode that allows embed-anything to expose an API endpoint compatible with the OpenAI embeddings format.

Why?
This would allow seamless integration with existing applications that expect OpenAI's API format, making embed-anything a drop-in replacement for local embedding models.

Expected API Format:

POST /v1/embeddings
{
"input": ["text to embed"],
"model": "your_model_name"
}


Response example:
```json
{
    "object": "list",
    "data": [
        {
            "object": "embedding",
            "index": 0,
            "embedding": [0.1, 0.2, 0.3, ...]
        }
    ],
    "model": "your_model_name",
    "usage": {
        "prompt_tokens": 10,
        "total_tokens": 10
    }
}

Would this be feasible?
Looking forward to your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions