[genui] get-started says the system prompt is 3-5K tokens, it's closer to 14K

Open
#14,019 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
dart, flutter
Domain
documentation

Research direction

Start with the GenUI get-started page at https://docs.flutter.dev/ai/genui/get-started and check how it describes the PromptBuilder.chat() prompt size. Verify the reported size for the basic catalog, then look into how to make a catalog with only the components an app uses. Done when the page gives a representative basic-catalog number and shows how to trim the catalog.

Written by the indexing model from the issue text.

Description

p2-medium

Page: https://docs.flutter.dev/ai/genui/get-started

The page says the PromptBuilder.chat() prompt might be 3,000 to 5,000+ tokens. I measured it and it's a lot bigger, about 3x:

final cat = BasicCatalogItems.asNoAssetCatalog();
final p = PromptBuilder.chat(
  catalog: cat,
  systemPromptFragments: ['You are a helpful assistant.'],
).systemPromptJoined();
print(p.length); // ~55K chars

With the basic catalog, two small custom items and a one-line fragment I got 55,247 chars, so roughly 13,800 tokens.

That matters because people will read "3-5K" and assume it fits small or on-device models. It doesn't.

Would be great if the page gave a real number for the basic catalog and showed how to trim it down (like a catalog with just the components your app uses).

genui 0.10.4, Flutter 3.47.9, Dart 3.13.7.

Dominant language
Dart
Stars
3.1k
Forks
3.5k
Avg merge
2d 10h
Merged PRs (30d)
88

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flutter/website

All issues in flutter/website

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.