Skip to content

Add classify() and a convert-time embedding stamp - #69

Open
Lazarus-931 wants to merge 2 commits into
Blaizzy:mainfrom
Lazarus-931:feature/embedding-classifier
Open

Add classify() and a convert-time embedding stamp#69
Lazarus-931 wants to merge 2 commits into
Blaizzy:mainfrom
Lazarus-931:feature/embedding-classifier

Conversation

@Lazarus-931

Copy link
Copy Markdown

Wanted to integrate mlx-embeddings as a provider behind nativ, just as a api provider for embedding.

But an issue is that vlm and emb. simultaneously exist in this library, this pr allows me to push a pr up to nativ( they will simply be accessible through api ) that will be able to reference their config key to permit embedding api call.

this pr just labels existing embedding models, and for future included ones, has a function(classify) to label them

cc: @Blaizzy

classify(config, model_path) returns {is_embedding, modality} in three steps:
1. an explicit config["mlx_embeddings"] stamp written by convert (authoritative;
   the only signal that separates an embedder from an identically-architected
   generative model, e.g. Qwen3-Embedding vs Qwen3 chat);
2. a maintained set of embedding model_types that have no generative twin;
3. a sentence-transformers pooling fallback for un-labeled/un-stamped models.

convert now stamps kind+modality onto converted models. Types shared with
chat/VLM models (qwen3, qwen3_vl, gemma3_text, lfm2) are intentionally left to
the stamp/pooling path since the type alone cannot disambiguate them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant