feat(config): add support for remote embedding services via config.toml#4284
feat(config): add support for remote embedding services via config.toml#4284siimons wants to merge 2 commits intoTabbyML:mainfrom
Conversation
|
May I ask why you don't use this configuration [model.embedding.http]
kind = "ollama/embedding"
model_name = "nomic-embed-text"
api_endpoint = "http://localhost:11434" |
|
Right - you can always configure a remote embedding through http endpoint, e.g https://tabby.tabbyml.com/docs/references/models-http-api/llama.cpp/ |
I understand now that Tabby already supports HTTP-based embedding backends via the Why I chose to propose
If you think this is redundant or beyond the scope of the Tabby configuration concept, no problem, I will understand the decision to reject or revise the PR. I just wanted to explain the motivation and maybe initiate a dialogue. |
Description
This pull request introduces support for remote embedding models in
config.toml, enabling users to delegate embedding generation to external servers. This is particularly valuable for environments without GPU or lacking the ability to runllama-serverlocally.What’s Changed
Added support for
[embedding]section withtype = "remote"andendpointfields inconfig.toml.Updated
embedding::create()andmodel::load_embedding()to supportModelConfig::Http(remote models).Prevents Tabby from launching the local
llama-serverprocess when using a remote embedding service.Keeps compatibility with local embeddings (no breaking changes).
Example Usage
Run an embedding service like:
Then launch Tabby:
Motivation
Currently, Tabby always attempts to launch its internal
llama-serverbinary, which fails on machines without compatible GPU or CUDA libraries. This PR introduces flexibility and portability, enabling Tabby to run in lightweight environments with minimal dependencies.How to Test
Start Tabby with a valid
config.tomlthat includes a remote embedding config.Verify that:
llama-serverKnown Limitations
This does not disable internal embeddings when
[embedding]is omitted (default behavior).The remote server must follow the expected API (e.g.,
/v1/embeddingsin OpenAI-compatible format).Request for Review
Would love feedback on:
Integration approach
Potential edge cases to test
Any docs you'd like me to include
Let me know if you'd like me to add a sample embedding server (Python FastAPI) or documentation PR as a follow-up!