Add LLM Model Finder App - #266
Conversation
- Create LlmModelFinder component for hardware-based model recommendation - Support searching Hugging Face with CPU/RAM/VRAM constraints - Implement task-based filtering (Text Gen, Chat, Coding, etc.) - Register app in the Apps page under LLM/AI category - Add unit tests for filtering and hardware estimation logic Co-authored-by: Oxygen-Low <95589118+Oxygen-Low@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
More reviews will be available in 20 minutes and 59 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new ChangesLLM Model Finder Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@client/components/apps/LlmModelFinder.test.tsx`:
- Around line 36-116: Add additional test cases to the LlmModelFinderApp test
suite to cover the missing critical scenarios. Create new it() tests that
verify: GPU mode toggle behavior with VRAM filtering, search query filtering
functionality, task switching with additionalTags matching, error handling when
the fetch request fails (using mockFetch.mockRejectedValueOnce), and filtering
behavior for models with unknown size where ramRequired equals zero. Each test
should follow the existing pattern by mocking fetch appropriately, rendering the
LlmModelFinderApp component, simulating user interactions (such as checkbox
toggles, input changes, or button clicks), and asserting that the correct models
appear or are filtered out based on the specific scenario being tested.
- Line 12: The assignment of MockResizeObserver to global.ResizeObserver in the
LlmModelFinder.test.tsx file causes a TypeScript type mismatch. Add an `as any`
type assertion to the MockResizeObserver assignment to suppress the type error
and ensure type safety compatibility between the mock and the actual
ResizeObserver interface.
In `@client/components/apps/LlmModelFinder.tsx`:
- Line 37: The cpuCores state variable declared with useState in the
LlmModelFinder component is not being used in any model filtering or fetch
logic. Either remove the cpuCores state variable declaration and setCpuCores
setter from the component if CPU-based filtering is not needed, or implement the
CPU-based filtering logic in your model fetch or filtering functions to actually
utilize the cpuCores value when determining which models to display or return to
the user.
- Around line 111-113: The catch block in the fetchModels method only logs
errors to the console, leaving users unaware of fetch failures. Add a new error
state to the LlmModelFinder component using useState, initialize it to null, and
clear it at the start of the fetchModels try block. In the catch block, set this
error state with a user-friendly message instead of only logging to console.
Then render this error state in the UI (for example, in the results area) to
display a visible error message to users when network or API errors occur.
- Line 98: The filtering logic in the fitsInHardware calculation is incorrectly
treating models with ramRequired === 0 (unknown size) as always fitting the
hardware by including them in the OR condition. Remove the ramRequired === 0
check from the condition so that only models with a known RAM requirement that
is less than or equal to hardwareLimit are considered as fitting. Alternatively,
if you want to include models with unknown sizes, add logic to mark them
separately in the UI with a visual indicator (such as a warning badge) to
clearly communicate to the user that the actual size is unknown and may not fit
their hardware.
- Around line 52-53: Add HTTP response status validation after the fetch call in
the LlmModelFinder component. After fetching the URL, check that response.ok is
true before attempting to call response.json(). If the response status is not ok
(indicating a 4xx or 5xx error), throw an error with a descriptive message that
prevents attempting to parse an error response as valid model data.
- Around line 241-247: The results area in the LlmModelFinder component does not
show any visual feedback when the loading prop is true. Currently the condition
checks models.length === 0 && !loading to display the empty state, but when
loading becomes true, nothing is rendered in that area. Restructure the
conditional rendering logic to first check if loading is true and display a
loading spinner or skeleton indicator, then fall back to the empty state message
when models.length === 0 && !loading is true, and finally render the models list
when models are available. This ensures users see a clear loading indicator
while models are being fetched.
- Line 312: The onClick handler that constructs the Ollama library URL is based
on an unverified assumption that HuggingFace model names directly map to Ollama
registry names, which is not reliable since the two registries maintain
separate, curated collections with different naming conventions. Either
implement an explicit mapping table that validates whether a given model exists
in both ecosystems before constructing the link (returning null or a disabled
state for unmapped models), or change the approach to direct users to the Ollama
library search page (e.g., ollama.com/search) instead of attempting automatic
linking to a potentially non-existent model page. Remove or refactor the regex
normalization logic as it only addresses version suffixes and does not solve the
fundamental ecosystem mismatch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 25529914-3c23-4fb6-8b97-87732f23df2e
📒 Files selected for processing (3)
client/components/apps/LlmModelFinder.test.tsxclient/components/apps/LlmModelFinder.tsxclient/pages/Apps.tsx
|
@jules Verify each finding against current code. Fix only still-valid issues, skip the Inline comments:
In
|
I have addressed all the feedback in the following ways: In
In
All tests have been updated and pass successfully. |
- Implement error handling and loading states in LlmModelFinder - Remove unused cpuCores state - Filter out models with unknown hardware requirements - Update Ollama links to use search - Expand test suite with GPU, search, error, and unknown size scenarios - Fix TypeScript type mismatch in test mocks Co-authored-by: Oxygen-Low <95589118+Oxygen-Low@users.noreply.github.com>
Adds a new app 'LLM Model Finder' to the platform. This app allows users to input their hardware specifications (RAM, CPU, GPU/VRAM) and a target task (e.g., Coding, Chatting) to find compatible LLM models on Hugging Face. It features parameter count estimation and RAM requirement calculation (assuming 4-bit quantization) with a mandatory 1GB system reservation.
PR created automatically by Jules for task 14585450540918251285 started by @Oxygen-Low
Summary by CodeRabbit
Release Notes
New Features
Tests