Skip to content

Conversation

@nvandessel
Copy link
Owner

Summary

Why revert instead of modify?

The replacement (hybridgroup/yzma, purego) has a fundamentally different architecture — no build tags, no CGo, no stub file. Cleaner to revert and re-add as stacked PRs:

  1. This PR — clean slate
  2. PR2 — pure Go foundations (interfaces, config, similarity)
  3. PR3 — yzma implementation

Test plan

  • go build ./cmd/floop — builds cleanly
  • go vet ./... — no issues
  • go test ./... — all 25 packages pass

🤖 Generated with Claude Code

llama-go requires git submodules, make libbinding.a, and a go.work
hack — it's not a self-contained Go module and breaks CI/CD.

Removes:
- LocalClient (local.go, local_stub.go) and all local tests
- CosineSimilarity and similarity tests
- EmbeddingComparer and Closer interfaces from client.go
- Local* config fields and env overrides
- "local" provider from config validation and CLI factory
- build-local Makefile target
- tcpipuk/llama-go dependency
- Embedding comparison path in store_dedup.go

Will be replaced by hybridgroup/yzma (purego, no CGo) in follow-up PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR reverts the previously-added llama-go based local LLM integration by removing the local provider path, its config fields/env overrides, and all related client code and tests. It also simplifies dedup similarity scoring by dropping the embedding-based fast path, leaving LLM CompareBehaviors (when available) plus a weighted Jaccard fallback.

Within the codebase this primarily affects configuration validation/loading (internal/config), client construction in the CLI entrypoint (cmd/floop), and deduplication similarity selection (internal/dedup/store_dedup.go). Build tooling is updated accordingly by removing the build-local Makefile target and the llama-go module dependency.

Confidence Score: 4/5

  • This PR is generally safe to merge; only minor correctness/doc drift was found.
  • Changes are primarily a revert/removal of local LLM code paths and dependencies, and the remaining LLM/dedup logic stays consistent. One concrete issue remains: LLMConfig.Provider still documents local as valid even though validation and CLI factory no longer support it, which can mislead users and tests/config writers.
  • internal/config/config.go

Important Files Changed

Filename Overview
Makefile Removes the build-local target and llama-go build tag usage; remaining targets unchanged.
cmd/floop/main.go Removes the "local" provider branch from createLLMClient and updates provider list comment.
go.mod Drops tcpipuk/llama-go dependency from module requirements.
go.sum Removes go.sum entries associated with the removed llama-go dependency.
internal/config/config.go Removes local-model config fields/env overrides and disallows "local" provider; provider doc comment still mentions "local" (needs update).
internal/config/config_test.go Updates config tests to remove local-provider cases and env override tests.
internal/dedup/dedup.go Updates SimilarityMethod documentation to remove "embedding" as a valid value.
internal/dedup/store_dedup.go Removes embedding-based similarity path; computeSimilarity now tries LLM CompareBehaviors then falls back to weighted Jaccard.
internal/llm/client.go Removes optional EmbeddingComparer and Closer interfaces from the llm client package.
internal/llm/local.go Deletes llamacpp-tagged LocalClient implementation (llama-go based).
internal/llm/local_integration_test.go Deletes local LLM integration tests gated on llamacpp+integration build tags.
internal/llm/local_stub.go Deletes non-llamacpp stub LocalClient implementation.
internal/llm/local_test.go Deletes unit tests for the LocalClient and related interfaces.
internal/llm/similarity.go Deletes CosineSimilarity helper previously used by embedding comparison.
internal/llm/similarity_test.go Deletes tests for CosineSimilarity helper.

Sequence Diagram

sequenceDiagram
  participant User as CLI User
  participant Config as internal/config
  participant Main as cmd/floop
  participant LLM as internal/llm
  participant Dedup as internal/dedup/store_dedup

  User->>Main: run floop
  Main->>Config: Load() / LoadFromFile()
  Config-->>Main: FloopConfig (LLM provider: anthropic/openai/ollama/subagent/"")
  Main->>LLM: createLLMClient(cfg)
  alt Provider == "subagent" or (Enabled && Provider == "")
    Main->>LLM: DetectAndCreate()
    LLM-->>Main: subagent client or nil
    alt nil
      Main->>LLM: NewFallbackClient()
    end
  else Provider == "openai" or "ollama"
    Main->>LLM: NewOpenAIClient(ClientConfig)
  else Provider == "anthropic"
    Main->>LLM: NewAnthropicClient(ClientConfig)
  else Provider empty/disabled
    Main-->>LLM: nil client
  end

  User->>Dedup: DeduplicateStore / FindDuplicates
  Dedup->>Dedup: computeSimilarity(a,b)
  alt UseLLM && client != nil && client.Available()
    Dedup->>LLM: CompareBehaviors(ctx,a,b)
    alt success
      LLM-->>Dedup: ComparisonResult(SemanticSimilarity)
    else error
      Dedup->>Dedup: weighted Jaccard fallback
    end
  else
    Dedup->>Dedup: weighted Jaccard fallback
  end
  Dedup-->>User: DuplicateMatch list / report
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

15 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 11, 2026

Additional Comments (1)

internal/config/config.go
Provider docs outdated

LLMConfig.Provider still documents "local" as a valid provider, but this PR removes local support (validation + CLI factory). This will mislead users and contradict Validate().

	// Provider identifies the LLM backend: "anthropic", "openai", "ollama", "subagent", or "" for disabled.

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