Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 refactor: Improve Params Handling, Remove Legacy Items, & Update Configs #6074

Merged
merged 18 commits into from
Feb 26, 2025

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Feb 26, 2025

Summary

  • Refactored stream handling in AnthropicClient by introducing a custom SplitStreamHandler that extracts delta text and reasoning smoothly, without needing to create new objects mid-stream
  • Removed legacy logic and environment references for OPENROUTER_API_KEY from .env.example, OpenAIClient, ModelService, and related tests.
  • Added comprehensive unit tests for getLLMConfig to verify proxy settings, reverse proxy URLs, and conditional inclusion of topK/topP parameters.
  • Restructured parameter handling in AnthropicClient so that top_k and top_p parameters are only included for non-claude-3.7 models, and I validated this behavior with targeted tests.
  • Updated maxOutputTokens handling and tests to enforce appropriate token cap limits across various Claude model variants.
  • Skipped index fixing in CI, development, and test environments within the Token model to avoid unnecessary index operations.
  • Adjusted default token values and schema transformations (including simplifying the googleSchema transformation) to better support model-specific constraints.
  • Excluded image files from service worker caching and revised client configuration (Vite config, tsconfig, and ESLint settings) to pre-cache all assets, in hopes of resolving offline usage.
  • Add frontend/backend feature for Resetting parameters

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change that improves code quality)
  • CI/Chore (updates to development workflows and configurations)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

@danny-avila danny-avila changed the title 🔧 refactor: Improve Claude 3.7 Handling, Remove Legacy Items, & Update Configs 🔧 refactor: Improve Params Handling, Remove Legacy Items, & Update Configs Feb 26, 2025
@danny-avila danny-avila merged commit be28000 into main Feb 26, 2025
7 checks passed
@danny-avila danny-avila deleted the chore/updates branch February 26, 2025 20:02
@KiGamji
Copy link
Contributor

KiGamji commented Feb 26, 2025

@danny-avila the top_p and top_k parameters need to be dropped only when thinking is enabled, otherwise they are supported for the Claude 3.7 Sonnet model

@danny-avila
Copy link
Owner Author

@KiGamji ok thanks

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.

[Bug]: Using OPENROUTER_API_KEY breaks all librechat.yaml custom endpoints
2 participants