Skip to content

Add interface compatibility spec#5

Merged
cpetersen merged 2 commits into
mainfrom
interface-compatibility-spec
Mar 24, 2026
Merged

Add interface compatibility spec#5
cpetersen merged 2 commits into
mainfrom
interface-compatibility-spec

Conversation

@cpetersen
Copy link
Copy Markdown
Member

Summary

  • Adds spec/ruby_llm/red_candle/interface_compatibility_spec.rb that probes the real class/method surface of both red-candle and ruby_llm — no mocks
  • Verifies Candle::LLM.from_pretrained, Candle::Device.cpu/.best, Candle::GenerationConfig.balanced, and Candle::Tokenizer are present
  • Verifies the ruby_llm provider contract: Provider inherits correctly and includes #complete, #stream, #list_models; Message, Chunk, and Model::Info accept the keyword args the plugin passes

Why this matters

The existing test suite uses MockCandleModel and stubs, so if red-candle or ruby_llm change their public APIs, every mock-based test still passes while production breaks silently. This spec catches those breakages immediately.

How it fits into CI

This spec is designed to run in the daily version-check cron job. When a new upstream release lands, these interface probes fail with self-explanatory messages (e.g., "Candle::GenerationConfig.balanced is missing — red-candle API may have changed"), giving us early warning before users hit runtime errors.

Test plan

  • bundle exec rspec spec/ruby_llm/red_candle/interface_compatibility_spec.rb — 13 examples, 0 failures

🤖 Generated with Claude Code

cpetersen and others added 2 commits March 5, 2026 13:23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby_llm now passes these keyword arguments to provider complete methods.
Accept them for interface compatibility (not yet used by local models).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpetersen cpetersen merged commit 44b7a88 into main Mar 24, 2026
1 check passed
@cpetersen cpetersen deleted the interface-compatibility-spec branch March 24, 2026 13:42
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