Skip to content

v0.2.0

Choose a tag to compare

@messkan messkan released this 28 Dec 11:32
· 12 commits to main since this release

Release Notes - v0.2.0

Release Date: December 28, 2025

馃帀 What's New

Multi-Provider Support

PromptCache now supports three major AI providers for embeddings and semantic verification:

  • OpenAI - text-embedding-3-small + gpt-4o-mini
  • Mistral AI - mistral-embed + mistral-small-latest
  • Claude (Anthropic) - voyage-3 (Voyage AI) + claude-3-haiku-20240307

Dynamic Provider Switching

Switch providers at runtime without restarting the service:

# Get current provider
curl http://localhost:8080/v1/config/provider

# Switch to Mistral
curl -X POST http://localhost:8080/v1/config/provider \
  -H "Content-Type: application/json" \
  -d '{"provider": "mistral"}'

Enhanced Configuration

New environment variables for fine-tuned control:

Provider Selection:

export EMBEDDING_PROVIDER=openai  # Options: openai, mistral, claude

Configurable Thresholds:

export CACHE_HIGH_THRESHOLD=0.70   # Direct cache hit (default: 0.70)
export CACHE_LOW_THRESHOLD=0.30    # Clear miss (default: 0.30)

Gray Zone Control:

export ENABLE_GRAY_ZONE_VERIFIER=true  # Enable/disable LLM verification

Performance & Benchmarking

New tools for testing and optimization:

  • scripts/run.sh - Easy project startup with validation
  • scripts/benchmark.sh - HTTP endpoint performance testing
  • internal/semantic/benchmark_test.go - Micro-benchmarks for core functions
  • Enhanced Makefile with make benchmark and make bench-go

Comprehensive Documentation

Full documentation site deployed to GitHub Pages:

  • Getting Started Guide
  • Complete REST API Reference
  • Provider Configuration Guide
  • Contributing Guidelines
  • All with code examples in Python, cURL, and JavaScript

馃敡 API Changes

New Endpoints

GET /v1/config/provider

Get the currently active provider:

{
  "provider": "openai",
  "available_providers": ["openai", "mistral", "claude"]
}

POST /v1/config/provider

Switch providers dynamically:

{
  "provider": "mistral"
}

Existing Endpoints

  • POST /v1/chat/completions - Unchanged, fully backward compatible

馃搳 Performance Improvements

  • Thread-safe provider switching with RWMutex
  • Optimized cosine similarity calculations
  • Efficient vector serialization/deserialization
  • Concurrent request handling preserved

Benchmark Results:

BenchmarkCosineSimilarity-10                     3252341    369.8 ns/op      0 B/op    0 allocs/op
BenchmarkFindSimilar-10                           194473   6183 ns/op    3585 B/op   13 allocs/op
BenchmarkSetProvider-10                          1000000   1096 ns/op       0 B/op    0 allocs/op
BenchmarkFindSimilar_MultipleEmbeddings-10         17383  68913 ns/op   35761 B/op  130 allocs/op

馃И Testing

  • 25+ comprehensive unit tests covering all providers
  • Provider factory tests with edge cases
  • Thread-safety tests for concurrent operations
  • Configuration validation tests
  • Gray zone behavior tests
  • All tests passing with >80% code coverage

馃摑 Documentation

New Documentation Files

Updated Files

馃攧 Migration Guide

From v0.1.x to v0.2.0

No breaking changes! v0.2.0 is fully backward compatible.

Optional Updates

  1. Set provider explicitly (defaults to OpenAI):

    export EMBEDDING_PROVIDER=openai
  2. Customize thresholds (optional):

    export CACHE_HIGH_THRESHOLD=0.70
    export CACHE_LOW_THRESHOLD=0.30
  3. Control gray zone verification (enabled by default):

    export ENABLE_GRAY_ZONE_VERIFIER=true

馃悰 Bug Fixes

  • Fixed thread-safety in provider access
  • Improved error handling for missing API keys
  • Enhanced configuration validation with fallback defaults

馃攼 Security

  • No security vulnerabilities introduced
  • All API keys remain secure in environment variables
  • No sensitive data logged

馃摝 Dependencies

  • Go 1.21+
  • Redis 7.0+
  • Provider SDKs:
    • OpenAI Go SDK
    • Mistral Go SDK (unofficial)
    • Anthropic Go SDK

馃殌 Deployment

Docker

docker-compose up

Manual

export EMBEDDING_PROVIDER=openai
export OPENAI_API_KEY=your-key
make run

馃檹 Acknowledgments

Thanks to all contributors and users who provided feedback!

馃摎 Resources

馃挰 Support

  • Open an issue on GitHub
  • Check the documentation
  • Review the contributing guide

Full Changelog: https://github.com/messkan/prompt-cache/blob/main/CHANGELOG.md