Skip to content

Conversation

@dbinky
Copy link
Owner

@dbinky dbinky commented Jan 16, 2026

Summary

  • Add support for Jina v4 embeddings (1024 dimensions, ~8GB) as optional upgrade from default v2 (768 dims, ~300MB)
  • Add pm config model [v2|v4] command to view/switch embedding models
  • Update install scripts (bash and PowerShell) with model selection prompt for Ollama provider
  • Implement model registry with dynamic dimensions and context size based on configured model

Changes

Model Registry (internal/embedder/models.go)

  • ModelInfo struct with name, dimensions, context size, and size metadata
  • Lookup functions: GetModelInfo, GetModelByFullName, GetDimensionsForModel, GetContextSizeForModel, GetShortNameForModel
  • Safe defaults (768 dims, 8192 context) for unknown models

OllamaClient Updates (internal/embedder/ollama.go)

  • Dimensions() returns dynamic dimensions based on configured model
  • ContextSize() returns dynamic context size (8K for v2, 32K for v4)
  • Removed hardcoded JinaContextSize constant

CLI (internal/cli/config_model.go)

  • pm config model - shows current model
  • pm config model v2|v4 - switches model (deletes existing index, prompts reindex)

Install Scripts

  • Bash (scripts/install.sh) and PowerShell (scripts/install.ps1) prompt for model choice when Ollama is selected
  • Default: v2 (Standard), Optional: v4 (Maximum quality)

Test Plan

  • All existing tests pass (go test -tags fts5 ./...)
  • Model registry tests cover all lookup functions
  • OllamaClient tests verify dynamic dimensions/context
  • Config model command tests cover show, switch, and error cases
  • Code review approved

🤖 Generated with Claude Code

dbinky and others added 18 commits January 11, 2026 18:12
Release v0.7.3 - Configurable timeouts for cold starts
Design for adding optional Jina v4 embeddings as an upgrade from
the default v2 model, selectable at install time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add testing strategy with 50+ test cases covering:
- Model registry (happy path, failures, edge cases)
- Ollama client dimensions
- Config model command (success, failure, error, edge cases)
- Daemon dimension mismatch detection
- Config loading and override behavior
- End-to-end integration tests

Includes test utilities to create and TDD workflow guidance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comprehensive implementation plan with 15 tasks and 24 unit tests.
Each task broken into bite-sized TDD steps: write test, verify fail,
implement, verify pass, commit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add GetModelInfo function that maps short names (v2, v4) to full Ollama
model metadata including dimensions, context size, and human-readable size.
Foundation for Jina v4 embedding support feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add function to look up model info by full Ollama model name instead of
short name. This enables reverse lookups when we have the full model
name from configuration but need its metadata.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add GetDimensionsForModel function that returns dimensions for a model
by full name, with DefaultDimensions (768) fallback for unknown models.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a function to get the short name (v2, v4) from a full Ollama model
name. Returns empty string for unknown models.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update OllamaClient.Dimensions() to use GetDimensionsForModel instead of
hardcoded 768. This enables correct dimension reporting for different
embedding models like Jina v2 (768 dim) vs Jina v4 (1024 dim).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add GetContextSizeForModel() helper and OllamaClient.ContextSize() method
that returns the appropriate context window size for the configured model
(8192 for v2, 32768 for v4). Update embed() to use dynamic context size
instead of hardcoded JinaContextSize constant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a new subcommand `pm config model` that displays the current
embedding model being used. Shows both the short name (v2/v4/custom)
and the full Ollama model name.

Model switching (with arguments) returns "not yet implemented" error,
to be completed in Task 3.2.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add switchModel function to allow switching between embedding models
(v2/v4). The command validates the target model, checks if already
using it, deletes existing database if present (since embeddings are
incompatible between models), and updates the config.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use db.DatabaseFile constant (index.db) instead of hardcoded
pommel.db which doesnt exist. Also clean up SQLite WAL and SHM
files when deleting the database during model switch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When selecting Local Ollama or Remote Ollama as the embedding provider,
users can now choose between:
- Standard (Jina v2 Code): ~300MB, faster, good quality
- Maximum (Jina v4 Code): ~8GB, slower, best quality

The selected model is used in both the config file generation and when
pulling the model from Ollama.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add v2/v4 Jina embedding model selection when Ollama is chosen as the
provider. Users can now choose between:
- Standard (v2): ~300MB, faster, good quality (recommended)
- Maximum (v4): ~8GB, slower, best quality

Changes:
- Add $script:SelectedModel variable to track selection
- Add Select-OllamaModel function for interactive model selection
- Call model selection in Setup-LocalOllama and Setup-RemoteOllama
- Update Write-GlobalConfig to use selected model name
- Update Install-EmbeddingModel to pull the selected model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code review recommended clearer help text about the consequence
of switching models (deletes existing index).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dbinky dbinky merged commit 945f74a into dev Jan 16, 2026
20 checks passed
@dbinky dbinky deleted the dev-jina-4 branch January 16, 2026 14:40
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