Repository navigation
Conversation
…, similarity finder processor, and embedding mapper processor
…ng map processor to put images on the scatterplot. Can be used for image walls later.
…3D map embedding processor
… using K-Means or HBDSCAN.
…dings, which is now fixed.
…frames in video embedder to prevent 1-frame viedos from failing.
… embeddinsg, using helpers
… memory otherwise
…es. This allows reusing of templates (e.g. tiktok-sample and tiktok-urls use tiktok's main one)
sal-uva
force-pushed
the
embedding-llms
branch
from
October 20, 2026 22:15
3b4a43f to
1da2907
Compare
…plit the sprite writing off into a child processor.
# Conflicts: # common/assets/llms.json
…, instead of just showing text
…, instead of just showing text
…d before) and embedding processors!
Member
Author
|
Updated, I think this is ready to merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Embedding support in back-end
LLM client
embed(), filled in byopenai_clientandollama_client. This could've used LangChain but it doesn't support multimodal embeddings yet...llm_prompterand the embedding processors. It uses Ollama for model capabilities or else checks whether "embed" appears in the model ID, which isn't great but there seems to be no clear endpoint for embedding capacities yet...resolve_model), so thellm.accessprivilege is applied everywhere. Applied tollm_prompterand embedding processors.Ollama
/embedendpoint. [There's quite a few embedding models on Ollama now!](https://ollama.com/search?c=embedding)api/showis not always reliable (not our fault).embed()can move to an OpenAI-compatible endpoint once Ollama does this, which they say they're working on.OpenAI / vLLM
/api/modelsor just/models). I decided it's better to keep them as one client anyway since there is a shared convention and maybe things will converge in the future./embed. Again, with some scaffolding to make sure the input format is correct with different modalities (text, image, video, etc).New processors
Generating:
embed_text.py: one vector per item.embed_media.py:embed_images.py,embed_videos.pyandembed_audio.py.Analysing:
reduce_embeddings.py: reduce to N dimensions with UMAP, t-SNE or PCA.cluster_embeddings.py: cluster with HDBSCAN or k-means.colink_urls's threading to prevent using 100% memory (capped at 90% for now).embedding_similarity.py: scores every item against a text you give it, embedded with the same model as the parent.latent_space_path.py: walks from one embedding to its nearest unvisited neighbour, on and on. Neighbourhood capped at 50k.Plotting:
embedding_map.py/embedding_map_3d.py: interactive HTML scatterplot of the reduced embeddings, canvas-rendered with pan/zoom and hover, self-contained with no external dependencies. Colours by cluster and can draw thumbnails instead of dots.embedding_streams.py: plots distance from a reference embedding over time, to show how 'stable' a set of embeddings stays. This works needs a bit of love still--to do!Media helpers:
media_thumbnails.py: square thumbnails for a media archive, with an optional column treshold filter.media_sprite.py: merges thumbnails into one sprite sheet plus a metadata file with each image's position. Used by the embedding plots to put images on the scatterplot wihtout having to load all images separately.Memory
embeddings.max_embeddingsadmin setting that caps how many embeddings one processor reads at once (default 500k, '0' for no limit). Applied to the generating and analysing processors.common/lib/embeddings.pyread vectors in batches.embedding_similaritysorts via a scratch file, so only each item's score and offset stay in memory rather than its text.Other stuff
llms.jsonfor third-party.llms.jsonnow also declaressupported_media_typesper model.__init__.pyto set an Explorer template and use this for all TikTok data sources (minus comments). Needs to be checked after redesign (where I added 'variants').media_type = image, so the thumbnail/sprite chain works on them.umap-learn, andscikit-learn>=1.3for HDBSCAN.questions/comments/stuff to think about
/embedendpoint through vLLM is not super reliable yet--there are not a lot of multimodal models beyond the Qwen3-VL one. I'll keep an eye out and update update when things have settledembeddingsas an output / 'media' type so that post-processors can easily run on it. And it'd be great to be able to import embedding datasets as well.bge-m3,all-minilm). LiteLLM has some indication of this but it's still in flux.forkis available (so not on Windows, but who cares about Windows?).media_sprite.pyprocessor: I'm doubting whether this can have a better spot. First I thought it could be merged with the image wall, but the output of the sprite needs to be a zip with the image and a metadata file listing the position of images so I kept them separate. But, it could also be integrated into the embedding plotters. Ultimately I think this is the right spot though. Maybe we want to use spritesheets as efficient thumbnail lookups in more visualizations in the future as well.Tests
Tested with an SRC server running vLLM with
Qwen3-VL-Embedding-8B(note:--runner poolingis required, otherwise the embeddings endpoint is not served at all), and a local Ollama withmxbai-embed-largeandembeddinggemma-2.