Skip to content

feat(memory_manager): add OrcaRouter as a named memory-manager backend - #76

Open
XiaoHuo888-hue wants to merge 1 commit into
zjunlp:mainfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

feat(memory_manager): add OrcaRouter as a named memory-manager backend#76
XiaoHuo888-hue wants to merge 1 commit into
zjunlp:mainfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Add OrcaRouter as a named memory-manager backend

OrcaRouter is an OpenAI-compatible LLM gateway (API base https://api.orcarouter.ai/v1, keys prefixed sk-orca-). It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

This PR registers OrcaRouter as a first-class named backend for MemoryManagerConfig, mirroring the existing DeepSeek provider — so users can select it via model_name: "orcarouter" instead of manually pointing a generic OpenAI-compatible endpoint.

Changes

  • src/lightmem/configs/memory_manager/base_config.py: add orcarouter_base_url config slot (defaults to https://api.orcarouter.ai/v1)
  • src/lightmem/configs/memory_manager/base.py: register orcarouter in MemoryManagerConfig._model_list
  • src/lightmem/factory/memory_manager/orcarouter.py: new OrcaRouterManager (subclasses DeepseekManager; OpenAI client, default model orcarouter/auto, key from ORCAROUTER_API_KEY or config.api_key)
  • src/lightmem/factory/memory_manager/factory.py: map orcarouterOrcaRouterManager
  • tests/test_orcarouter.py: unit tests for config acceptance, factory instantiation, defaults, custom base URL, and missing-key error
  • README.md: news entry + supported-backends table + config example

Example

"memory_manager": {
    "model_name": "orcarouter",
    "configs": {
        "model": "orcarouter/auto",
        "api_key": "sk-orca-...",
        "orcarouter_base_url": "https://api.orcarouter.ai/v1"
    }
}

Validation

  • pytest tests/ — 7 passed (2 existing + 5 new)
  • flake8 / isort clean on new files; py_compile OK
  • Live test against the real OrcaRouter endpoint through the new OrcaRouterManager path returned ORCA-LIVE-OK with valid token usage (HTTP 200)

Disclosure: I'm an engineer on the OrcaRouter team.

Add an OpenAI-compatible OrcaRouter provider, mirroring the existing
DeepSeek backend. OrcaRouter exposes an OpenAI-compatible endpoint at
https://api.orcarouter.ai/v1 with sk-orca- prefixed keys.

- Register `orcarouter` in MemoryManagerConfig._model_list
- Add `orcarouter_base_url` config slot in BaseMemoryManagerConfig
- Add OrcaRouterManager (subclasses DeepseekManager) + factory mapping
- Add unit tests + README docs

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
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