Add new models and providers (OpenAI, SambaNova)#174
Conversation
WalkthroughThe PR updates README formatting and badges, adds OpenAI and SambaNova provider/model entries and env key mapping, widens API key validation to 6–200 chars and enables Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App as app.py
participant UI as build_ui()
Note over App,UI `#DDEBF7`: App process start (module run)
User->>App: run script
App->>UI: call build_ui()
UI-->>User: render UI
sequenceDiagram
participant Init as LiteLLM init
participant LLMHelper as llm_helper
Note over LLMHelper,Init `#F7F0DD`: LLM initialization path
LLMHelper->>Init: import/setup litellm
LLMHelper-->>Init: set drop_params = true
LLMHelper->>LLMHelper: validate API key (regex 6–200)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app.py (1)
146-147: Update the error message to match the updated API key length validation.The error message states "6-94 characters," but the
API_KEY_REGEXinsrc/slidedeckai/helpers/llm_helper.py(Line 33) now accepts 6-200 characters. This inconsistency will confuse users whose valid API keys (95-200 characters) are accepted by the validation logic but described as invalid in the error message.Apply this diff to fix the error message:
handle_error( 'The LLM settings do not look correct. Make sure that an API key/access token' - ' is provided if the selected LLM requires it. An API key should be 6-94 characters' + ' is provided if the selected LLM requires it. An API key should be 6-200 characters' ' long, only containing alphanumeric characters, hyphens, and underscores.\n\n' 'If you are using Azure OpenAI, make sure that you have provided the additional and' ' correct configurations.', False )
♻️ Duplicate comments (1)
README.md (1)
98-100: Model names should be verified (related to global_config.py verification).The OpenAI model names listed here (GPT-4.1-mini, GPT-4.1-nano, GPT-5) match those added in
src/slidedeckai/global_config.pybut require verification. See the verification request in the review comment forsrc/slidedeckai/global_config.pyLines 103-117.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(3 hunks)app.py(1 hunks)src/slidedeckai/global_config.py(9 hunks)src/slidedeckai/helpers/llm_helper.py(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: barun-saha
Repo: barun-saha/slide-deck-ai PR: 139
File: helpers/llm_helper.py:70-84
Timestamp: 2025-09-23T04:32:09.863Z
Learning: Hugging Face model support has been discontinued in the slide-deck-ai project, so PROVIDER_HUGGING_FACE should remain commented out in GlobalConfig.VALID_PROVIDERS and validation should continue rejecting 'hf' providers.
📚 Learning: 2025-09-23T04:32:09.863Z
Learnt from: barun-saha
Repo: barun-saha/slide-deck-ai PR: 139
File: helpers/llm_helper.py:70-84
Timestamp: 2025-09-23T04:32:09.863Z
Learning: Hugging Face model support has been discontinued in the slide-deck-ai project, so PROVIDER_HUGGING_FACE should remain commented out in GlobalConfig.VALID_PROVIDERS and validation should continue rejecting 'hf' providers.
Applied to files:
src/slidedeckai/global_config.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test (3.10)
🔇 Additional comments (7)
app.py (1)
545-545: LGTM! Clean refactor of the entry point.Directly calling
build_ui()under the__main__guard simplifies the code structure by removing an unnecessary wrapper function.src/slidedeckai/helpers/llm_helper.py (1)
16-17: LGTM! Enables better provider compatibility.Setting
litellm.drop_params = Trueallows LiteLLM to ignore unsupported parameters when making requests to different providers, improving cross-provider compatibility.src/slidedeckai/global_config.py (3)
28-28: LGTM! OpenAI provider integration follows the established pattern.The OpenAI provider constant, mapping, validation set, and environment key configuration are correctly structured and consistent with other providers in the codebase.
Also applies to: 42-42, 51-51, 61-61
156-163: LGTM! Documentation updated to include new providers.The provider help text correctly documents the new OpenAI (
[oa]) and SambaNova ([sn]) provider codes.
103-117: The flagged model names are valid; this review comment is incorrect.The OpenAI API documentation confirms that
gpt-4.1-miniandgpt-4.1-nanoare valid GPT-4.1 family models, andgpt-5-nanois a valid GPT-5 family model. The code entries at lines 103-117 accurately reflect OpenAI's current supported models as of November 2025. The[oa]prefix is a local naming convention in this codebase and does not affect API compatibility.Likely an incorrect or invalid review comment.
README.md (2)
14-17: LGTM! Added useful project badges.The PyPI, License, and Streamlit badges improve the README by providing quick access to important project information and metrics.
161-161: LGTM! Improved formatting for important information.Using blockquote style with an emoji effectively highlights this critical step about running
git lfs pull.
| '[sn]DeepSeek-V3.1-Terminus': { | ||
| 'description': 'fast, detailed', | ||
| 'max_new_tokens': 8192, | ||
| 'paid': True, | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
Verify the SambaNova model name with the official API documentation.
The model name DeepSeek-V3.1-Terminus should be verified against SambaNova's API documentation to ensure it's correctly specified and currently supported.
Please search the web to verify the SambaNova model names:
🌐 Web query:
What models are available through SambaNova Cloud API as of November 2025?
💡 Result:
Short answer — SambaNova Cloud exposes a broad catalog of open and proprietary LLMs as of November 22, 2025, including (representative list):
- DeepSeek family: DeepSeek-R1 (671B) and DeepSeek V3 series. [1][2]
- Meta Llama families: Llama 3.x (multiple sizes including 405B, 90B, 70B, 11B, 8B, 1–3B variants) and Llama 4 Maverick (17B). [3][4][5]
- Qwen family: Qwen 2.5 Coder (32B, 72B) and Qwen3 (e.g., 32B). [6][5]
- Samba-1 family / routers and CoE variants (Samba-1-Instruct-Router, Samba-1-Chat-Router, Samba-1 Turbo options). [4]
- Other multimodal and embedding models listed in SambaNova docs (CLIP, DePlot, E5 Large V2 and related multimodal checkpoints). [4]
Sources / further reading:
- SambaNova Cloud dashboard / model listing. [cloud.sambanova.ai]. [1]
- SambaNova press material announcing DeepSeek‑R1 availability. [2]
- sambanova-gradio / registry (explicit model IDs for Llama 3.2 / 3.1 families). [3]
- SambaNova documentation / release notes (SambaStudio model cards, routers, multimodal models). [4]
- Third‑party integrations / docs referencing available models (ElevenLabs integration listing popular SambaNova models). [5]
- SambaNova blog post: Qwen 2.5 Coder on SambaNova Cloud. [6]
If you’d like, I can fetch the live model catalog (names + exact model IDs and context windows) from your SambaNova Cloud API endpoint and format it for you — do you want me to do that?
Correct the SambaNova model name—DeepSeek-V3.1-Terminus is not available in SambaNova Cloud API.
SambaNova Cloud exposes DeepSeek-R1 and DeepSeek V3 series, but DeepSeek-V3.1-Terminus does not appear in the documented model catalog. Update the model identifier to match an available DeepSeek variant (e.g., DeepSeek-V3 or DeepSeek-R1) to prevent runtime failures when this configuration is used.
🤖 Prompt for AI Agents
In src/slidedeckai/global_config.py around lines 128 to 132, the SambaNova model
identifier 'DeepSeek-V3.1-Terminus' is invalid and will cause runtime failures;
replace it with a valid SambaNova model name such as 'DeepSeek-V3' (or
'DeepSeek-R1' if intended) and update the dictionary key and any related
metadata (description, max_new_tokens, paid flag) as needed to reflect the
chosen variant so the configuration matches the documented SambaNova Cloud model
catalog.
Closes #167.
Summary by CodeRabbit
New Features
Documentation
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.