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

Add configurable context window size #364

Merged
merged 4 commits into from
Mar 24, 2025

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 24, 2025

Description

Adds a configuration option to manually specify the context window size in mycoder.config.js.

Changes

  • Added contextWindow configuration option to manually specify the context window size
  • Updated all LLM providers to use this configuration when a model's context window is not known
  • Updated documentation in README.md and docs package
  • Added special documentation for Ollama users since they're more likely to need this feature

Motivation

When using models that are not known by the tool (especially with Ollama where there are many possible models), users need a way to manually specify the context window size so that:

  1. Token usage tracking can work correctly
  2. Automatic compaction can be triggered when appropriate

Related Issues

@bhouston bhouston merged commit 7a2892e into main Mar 24, 2025
1 check passed
Copy link

sentry-io bot commented Mar 26, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 200130 tokens > 200000 maximum"}} AnthropicProvider.generateText(anthropic.ts) View Issue
  • ‼️ Error: Connection error. AnthropicProvider.generateText(anthropic.ts) View Issue

Did you find this useful? React with a 👍 or 👎

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.

Add configurable context window size
1 participant