Skip to content

feat: add Novita AI as LLM provider#800

Open
Alex-wuhu wants to merge 1 commit intosupermemoryai:mainfrom
Alex-wuhu:novita-integration
Open

feat: add Novita AI as LLM provider#800
Alex-wuhu wants to merge 1 commit intosupermemoryai:mainfrom
Alex-wuhu:novita-integration

Conversation

@Alex-wuhu
Copy link

Summary

Add Novita AI as a new LLM provider. Novita offers an OpenAI-compatible API with competitive pricing and a wide selection of open-source models.

Changes

  • New Novita provider following existing provider patterns
  • API key configuration via NOVITA_API_KEY environment variable
  • Support for chat, completion, and embedding models

Configuration

NOVITA_API_KEY=your_key_here

Endpoint: https://api.novita.ai/openai

Adds a dedicated Novita AI provider integration following the OpenAI SDK pattern:
- New novita submodule with withSupermemory middleware
- Supports OpenAI-compatible endpoint (https://api.novita.ai/openai)
- Uses NOVITA_API_KEY env var for authentication
- Exports NOVITA_MODELS constants with model IDs (kimi-k2.5, glm-5, minimax-m2.5)
- Includes unit tests for the integration
@graphite-app graphite-app bot requested a review from Dhravya March 24, 2026 12:04

const conversationId = options?.conversationId
const mode = options?.mode ?? "profile"
const addMemory = options?.addMemory ?? "never"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The addMemory option is declared and its value is read, but it is never used, causing the conversation-saving feature to silently fail when enabled.
Severity: CRITICAL

Suggested Fix

In createWithMemory and createResponsesWithMemory, add logic to check if addMemory is set to "always". If it is, call the addMemoryTool() function to persist the conversation content to Supermemory, similar to the implementation in openai/middleware.ts.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/tools/src/novita/middleware.ts#L49

Potential issue: The `addMemory` configuration option is defined in the
`NovitaMiddlewareOptions` and its value is captured in the `novita` middleware function,
but the variable is never subsequently used. This means that when a user sets
`addMemory: "always"`, expecting conversations to be saved, the functionality will
silently fail. Unlike the corresponding OpenAI middleware, the Novita implementation
lacks the logic in `createWithMemory` and `createResponsesWithMemory` to check this flag
and call a memory-saving utility like `addMemoryTool()`. This results in a functional
gap where conversations are never persisted to memory.

Did we get this right? 👍 / 👎 to inform future reviews.

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