Skip to content

Feat: More Llm API#113

Merged
CaralHsi merged 11 commits intoMemTensor:devfrom
CaralHsi:feat/more-llm-api
Jul 19, 2025
Merged

Feat: More Llm API#113
CaralHsi merged 11 commits intoMemTensor:devfrom
CaralHsi:feat/more-llm-api

Conversation

@CaralHsi
Copy link
Collaborator

@CaralHsi CaralHsi commented Jul 17, 2025

Description

Summary: (summary)

Fix: #112

Reviewer: @(reviewer)

Checklist:

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have added necessary documentation (if applicable) | 我已添加必要的文档(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

@CaralHsi CaralHsi marked this pull request as ready for review July 17, 2025 11:31
@CaralHsi CaralHsi requested review from Ki-Seki and fridayL July 17, 2025 11:34
@Ki-Seki Ki-Seki requested a review from Copilot July 18, 2025 07:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for more LLM API providers by implementing Qwen and DeepSeek integrations with streaming capabilities. The changes extend the existing LLM factory pattern to support additional OpenAI-compatible APIs and enhance reasoning model support with think tag processing.

  • Adds QwenLLM and DeepSeekLLM classes that inherit from OpenAILLM for API compatibility
  • Implements streaming generation support across OpenAI, Qwen, and DeepSeek LLMs with reasoning content handling
  • Updates the base LLM interface to include abstract generate_stream method

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/memos/llms/qwen.py New QwenLLM implementation with generate and generate_stream methods
src/memos/llms/deepseek.py New DeepSeekLLM implementation with generate and generate_stream methods
src/memos/llms/openai.py Added generate_stream method to OpenAILLM and AzureLLM classes
src/memos/llms/base.py Added abstract generate_stream method to BaseLLM interface
src/memos/configs/llm.py Added QwenLLMConfig and DeepSeekLLMConfig configurations
src/memos/llms/factory.py Registered new LLM backends in factory mapping
tests/llms/test_qwen.py Comprehensive tests for QwenLLM generate and streaming functionality
tests/llms/test_deepseek.py Comprehensive tests for DeepSeekLLM generate and streaming functionality
tests/llms/test_openai.py Added streaming tests for OpenAI LLM
examples/basic_modules/llm.py Added usage examples for new LLM providers
src/memos/templates/mem_reader_prompts.py Minor language instruction clarification
src/memos/llms/ollama.py Added NotImplementedError stub for generate_stream

@CaralHsi CaralHsi changed the title Feat/more llm api Feat: More Llm API Jul 18, 2025
CaralHsi and others added 4 commits July 18, 2025 16:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CaralHsi CaralHsi merged commit 4572d30 into MemTensor:dev Jul 19, 2025
16 checks passed
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.

2 participants