Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalkerrolandwalker commented Oct 25, 2025

Description

  • truncate text/binary sample data fields to 1024 characters (or smaller if judged to be needed)
  • truncate entire tables from schema representation if the representation is very large
  • for latency improvement, cache sample data and schema representation, passing the dbname in both cases to invalidate the cache if changing the db
  • add separate progress message when generating sample data

The target_size values are chosen somewhat arbitrarily, and it could be nice for the user to be able to control these.

We could also apply final size limits to the prompt string, though meaning-preserving truncation at that point is harder.

Addresses #1348.

Untested at the time of writing.

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

@rolandwalkerrolandwalker self-assigned this Oct 25, 2025
@rolandwalkerrolandwalkerforce-pushed the RW/conserve-llm-tokens-and-cache branch from 8cf2200 to a4eefeaCompareOctober 25, 2025 22:40
@rolandwalkerrolandwalker changed the title Reduce size of LLM promptsReduce size of LLM prompts + cache contextOct 27, 2025
@rolandwalkerrolandwalker changed the title Reduce size of LLM prompts + cache contextReduce size of LLM prompts + cache per-schema contextOct 27, 2025
@rolandwalkerrolandwalkerforce-pushed the RW/conserve-llm-tokens-and-cache branch 3 times, most recently from 6858160 to 6ed2c19CompareNovember 1, 2025 14:11
 * truncate text/binary sample data fields to 1024 characters (or smaller if judged to be needed) * truncate entire tables from schema representation if the representation is very large * for latency improvement, cache sample data and schema representation, passing the dbname in both cases to invalidate the cache if changing the db * add separate progress message when generating sample data The target_size values are chosen somewhat arbitrarily. We could also apply final size limits to the prompt string, though meaning-preserving truncation at that point is harder. Addresses #1348.
@rolandwalkerrolandwalkerforce-pushed the RW/conserve-llm-tokens-and-cache branch from 6ed2c19 to 42c18e7CompareNovember 1, 2025 14:25
Sign up for freeto 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.

2 participants

@rolandwalker