Skip to content

Conversation

@Nsuccess
Copy link

Summary

Implements Anthropic Claude as an LLM provider for MemU, enabling chat completions and vision capabilities using Claude models including the latest Opus 4.5.

Changes

New Files

  • src/memu/llm/backends/claude.py - ClaudeLLMBackend for HTTP client
  • src/memu/llm/claude_sdk.py - ClaudeSDKClient for SDK-based usage
  • docs/claude-provider.md - Setup and usage documentation
  • tests/test_claude.py - 19 unit tests

Modified Files

  • src/memu/llm/backends/__init__.py - Export ClaudeLLMBackend
  • src/memu/llm/http_client.py - Register Claude backend, handle auth headers

Implementation

  • Proper Claude API format (system as top-level param, content blocks)
  • Claude-specific auth headers (x-api-key, anthropic-version)
  • Vision support with base64 image format
  • Clear documentation on limitations (no embeddings, no transcription)

Supported Models

  • claude-opus-4-5-20251124 - Opus 4.5 (default, most intelligent)
  • claude-opus-4-20250514 - Opus 4
  • claude-sonnet-4-5-20250929 - Sonnet 4.5
  • claude-sonnet-4-20250514 - Sonnet 4
  • claude-haiku-4-5-20251015 - Haiku 4.5

Tests

All 19 tests passing.

Closes #177

@Jununn
Copy link
Contributor

Jununn commented Jan 13, 2026

Hi, the build for this PR is not passing yet. Please make the necessary updates, and we’ll review again after that. Thanks! @Nsuccess

@Nsuccess
Copy link
Author

Hi, the build for this PR is not passing yet. Please make the necessary updates, and we’ll review again after that. Thanks! @Nsuccess

Hi @Jununn
I've pushed the fixes for the trailing whitespace and formatting issues that were causing the CI to fail. The changes include:

Fixes:

Removed all trailing whitespace from claude_sdk.py, backends/claude.py, and test_claude.py
Fixed blank line formatting to comply with ruff
Added:

examples/example_claude_provider.py

  • End-to-end runnable example demonstrating the full workflow (memorize → retrieve)
    Updated docs/claude-provider.md with environment variable setup and example reference
    The workflow is currently awaiting approval to run. Could you please review it when you get a chance? Thanks

@Nsuccess Nsuccess force-pushed the feature/claude-model-provider branch from bc337ac to f73c525 Compare January 13, 2026 14:47
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.

[2026NewYearChallenge] Model Provider Extensions — Claude

2 participants