Move os-me OllamaEmbedder onto LLM.embed #1470
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1470
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
plugins/os-me/lib/os_me/ollama_embedder.rbposts to Ollama throughDecision::Model::Http::Connection. That is decision-model transport. The cc-os spec (docs/llm-stack/spec.md, build-order step 4) moves this call ontoLLM.embedfromllm-stack.Reproduce
n/a: refactor. No defect to reproduce.
Approach
Keep
OsMe::OllamaEmbedder#embed(texts). It must still take an Array of Strings and return an Array of vectors.CandidateRefreshcalls it throughOllamaEmbedder.standard.Replace the HTTP connection with a call to
LLM.embed. Remove theMODEL,BASE_URL, andTIMEOUTconstants. Move the model name and the endpoint into anllm-stackprofile. WireLLM.configureat the os-me entry point, as the other os-mellm-stackcallers do.Update
plugins/os-me/test/ollama_embedder_test.rb. The fake must stand in for theLLMclient, not forpost_json. Bump thellm-stackrevision inplugins/os-me/Gemfile.lockto the release that shipsLLM.embed.Required work:
Decision::Model::Httpinplugins/os-me/lib/os_me/ollama_embedder.rbLLM.embedin the embedder — check: presentLLM.embedinplugins/os-me/lib/os_me/ollama_embedder.rbplugins/os-me/test/ollama_embedder_test.rbfor the new call.llm-stackpin inplugins/os-me/Gemfile.lock.Orchestrator work: run
bin/refresh-pluginsafter the change.Acceptance criteria
OsMe::OllamaEmbedder#embedruns, then it returns two vectors in input order.OsMe::OllamaEmbedder, when its source is read, then it holds no reference toDecision::Model::Http.OsMe::CandidateRefresh, when it runs with the standard embedder, then it embeds throughLLM.embed.plugins/os-me/Gemfile.lock, when it is read, then itsllm-stackrevision is one that shipsLLM.embed.Owner sketch
Non-goals
PatternClustererorCandidateRefresh.Blocked by: jared/llm-stack#5
Origin
docs/llm-stack/spec.md, build-order step 4. Jared asked for this ticket and for the matchingllm-stackticket in session 4924697c-7a72-4455-a9f0-ba97fc3f1c6d.llm-stackhad noembed← DESIGN (docs/llm-stack/spec.md, section 6, step 4)VERDICT: CREATE
plugins/os-me/lib/os_me/ollama_embedder.rbllm-stack 0.2.0 has
LLM.embed. Pin commit:88b5f17144f06b449271cb970974a6c031f0d40a(tagv0.2.0, jared/llm-stack#5 closed).Facts for the swap of
plugins/os-me/lib/os_me/ollama_embedder.rb:LLM.embed(profile: :nomic, texts: [...]).texts:is a keyword, not positional as in the spec sketch.{ provider: "ollama", model: "nomic-embed-text" }. No credential.endpoint:is optional; defaulthttp://localhost:11434. The gem appends/v1, so give the host only.LLM::Embeddingwithvectors(Array of Float arrays, one per text, input order),usage,cost(0),meta. The adapter calls.vectors.POST /v1/embeddings, not native/api/embed. Spike: each text embedded alone gave the same vector as in the batch.LLM::ProviderError. Timeout: 60 s.docs/llm-stack/spec.md: the "Not built" header is stale (steps 1 to 4 are now built), and the sketch shows positionaltexts.Work started on branch ticket-1470 via /os-sdlc:implement (poodr-ticket-implementation). Gem side shipped: llm-stack 0.2.0 at 88b5f17 (jared/llm-stack#5).
Follow-up dropped by ticket-skeptic (need-to-exist): OllamaEmbedder.standard sets the global client with LLM.configure, while HeadlessRunner injects an LLM::Client instance. No collision exists today (no other os-me caller uses LLM.configure). If a second caller collides, file it against the llm-stack API design. Note: this ticket's text wrongly said other os-me callers use LLM.configure.
Resolution
Done: OsMe::OllamaEmbedder now calls LLM.embed(profile: :nomic, texts:).vectors on llm-stack 0.2.0; Decision::Model::Http transport and MODEL/BASE_URL/TIMEOUT removed; os-me Gemfile.lock pins llm-stack 88b5f17 (0.2.0).
Evidence: Implementation 215 complete (14 dispatches, 1 reroute onto poodr-guard-implementation for a test-fake defect); suite + required-work gates green; mutation check passed twice; commit
46a86534fast-forwarded to main.Follow-ups: Inject the client instead of LLM.configure: dropped by ticket-skeptic (need-to-exist), reason posted on this ticket. HeadlessClaude replacement already filed as #1471 (blocked by jared/decision-model#11).