Skip to content

feat(kiali): Reduce the Tokens consumption in resources details and lists#816

Open
aljesusg wants to merge 1 commit intocontainers:mainfrom
aljesusg:format_kiali_tools_output
Open

feat(kiali): Reduce the Tokens consumption in resources details and lists#816
aljesusg wants to merge 1 commit intocontainers:mainfrom
aljesusg:format_kiali_tools_output

Conversation

@aljesusg
Copy link
Contributor

@aljesusg aljesusg commented Feb 26, 2026

This is the first step of reduce the tokens in kiali toolsets.

📉 Resource Usage Reduction

This PR significantly optimizes the payload for several key views. Below is a breakdown of the token and character count reductions.

Resource Metric Before After % Reduction
Services List Tokens 5,232 1,957 -62.6%
Characters 20,351 7,508 -63.1%
Workload List Tokens 11,167 1,469 -86.8%
Characters 42,676 5,209 -87.8%
Service Detail Tokens 3,223 301 -90.7%
(productpage) Characters 12,466 952 -92.4%
Workload Detail Tokens 1,924 331 -82.8%
(productpage-v1) Characters 6,858 1,014 -85.2%

Summary of Impact

  • Total Token Savings: 17,488 tokens removed.
  • Performance: Drastic reduction in data transfer and parsing overhead, particularly for Service Detail which saw a >90% decrease.

The idea is to adapt all tools output to this.

cc @josunect

@aljesusg aljesusg force-pushed the format_kiali_tools_output branch 3 times, most recently from 9a7689f to 2a821ca Compare February 26, 2026 09:06
Copy link
Contributor

@josunect josunect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG!

The list services returns more reduced data:

Image Image

@aljesusg
Copy link
Contributor Author

Don't merge it please. Let me add more stuff here

@Cali0707
Copy link
Collaborator

@aljesusg are the eval scores staying steady with this token reduction?

@aljesusg
Copy link
Contributor Author

Not, that result was from other tool. I am running the tool right now to check the improvement.

Anyway I want to add more stuff.

@aljesusg
Copy link
Contributor Author

BTW how can we run the geval CI for kiali suite in the PR? I found that 2 tests are not working

@Cali0707
Copy link
Collaborator

BTW how can we run the geval CI for kiali suite in the PR? I found that 2 tests are not working

We seem to be having some issues with the keys set up in CI in this repo currently, otherwise anyone with write access could trigger the evals on this PR. I'll see if I can get that resolved soon and run them here, otherwise if you are able to run it locally and share the results that would also be interesting

Since they aren't cheap we are not running them by default...

@Cali0707
Copy link
Collaborator

/run-mcpchecker kiali

@github-actions
Copy link

mcpchecker MCP Evaluation Results

Commit: 2a821ca
Summary: 9/18 tasks passed (50.0%)

Metric Result
Tasks Passed 9/18
Assertions Passed 51/51
Overall ❌ Failed

View full results

@aljesusg
Copy link
Contributor Author

Weird...it seems that kind cluster with kiali setup is not set before gevals run... maybe we should add some wait until...

@Cali0707
Copy link
Collaborator

Huh, the "install istio/kiali" step completed successfully, maybe we should add some status checks in that step to make sure everything comes ready?

@aljesusg
Copy link
Contributor Author

aljesusg commented Feb 26, 2026

Yes...let me check...I'll add a wait condition with a check in kubernetes before, it's hard to test actions without rights ^^ (I am not requesting them :))

@Cali0707
Copy link
Collaborator

I don't have the ability to give perms, but feel free to ping me to run things

@aljesusg
Copy link
Contributor Author

Thanks !!!

@aljesusg
Copy link
Contributor Author

Yes....I am seeing so yes we need to make some wait condition

{"errors":{"graph":"kiali client not initialized","health":"kiali client not initialized","mesh_status":"kiali client not initialized","namespaces":"kiali client not initialized"}}"

@matzew
Copy link
Collaborator

matzew commented Feb 27, 2026

/run-mcpchecker kiali

I guess on downstream we can these more frequently /cc @mvinkler

@matzew
Copy link
Collaborator

matzew commented Feb 27, 2026

/run-mcpchecker kiali

@github-actions
Copy link

mcpchecker MCP Evaluation Results

Commit: 2a821ca
Summary: 7/18 tasks passed (38.9%)

Metric Result
Tasks Passed 7/18
Assertions Passed 51/51
Overall ❌ Failed

View full results

@aljesusg aljesusg changed the title Reduce the Tokens consumption in serviceList feat(kiali): Reduce the Tokens consumption in resources details and lists Mar 3, 2026
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
@aljesusg aljesusg force-pushed the format_kiali_tools_output branch from d35c3cf to b0ae967 Compare March 3, 2026 10:06
@aljesusg
Copy link
Contributor Author

aljesusg commented Mar 3, 2026

📉 Resource Usage Reduction

This PR significantly optimizes the payload for several key views. Below is a breakdown of the token and character count reductions.

Resource Metric Before After % Reduction
Services List Tokens 5,232 1,957 -62.6%
Characters 20,351 7,508 -63.1%
Workload List Tokens 11,167 1,469 -86.8%
Characters 42,676 5,209 -87.8%
Service Detail Tokens 3,223 301 -90.7%
(productpage) Characters 12,466 952 -92.4%
Workload Detail Tokens 1,924 331 -82.8%
(productpage-v1) Characters 6,858 1,014 -85.2%

Summary of Impact

  • Total Token Savings: 17,488 tokens removed.
  • Performance: Drastic reduction in data transfer and parsing overhead, particularly for Service Detail which saw a >90% decrease.

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.

4 participants