Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: read from litellm defaults for context window limits#204

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
shreyashankar wants to merge1 commit intolotus-data:main
base:main
Choose a base branch
Loading
fromshreyashankar:main

Conversation

@shreyashankar
Copy link

@shreyashankarshreyashankar commentedAug 21, 2025
edited
Loading

Purpose

This PR reads from litellm'smodel_cost defaults instead of using hardcoded values for context limits. The LM class now automatically derivesmax_ctx_len andmax_tokens from litellm's model information when these parameters are not explicitly provided.

Test Plan

Tested a lotus tutorial and my own scripts with long documents with the gpt-4.1-mini model (which has a 1M context window), to ensure we weren't running into context window issues.

Test Results

N/A

(Optional) Documentation Update

N/A

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, updating docstrings
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

mypy was failing before making the change; I didn't touch files outside oflm.py.

BEFORE SUBMITTING, PLEASE READhttps://github.com/lotus-data/lotus/blob/main/CONTRIBUTING.md
anything written below this line will be removed by GitHub Actions

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@shreyashankar

[8]ページ先頭

©2009-2025 Movatter.jp