gitingest icon indicating copy to clipboard operation
gitingest copied to clipboard

feat(ui): add Token Estimator link to footer

Open HmbleCreator opened this issue 6 months ago • 5 comments

Summary

This PR adds a "Token Estimator" link to the footer of the Gitingest web frontend. The link points to https://gitingest.com/tokencount, allowing users to easily access a tool for estimating token counts in pasted text.

Details

  • UI Change:

    • Added a new link labeled Token Estimator (with a counter icon) to the left column of the footer, alongside the Extension and Python package links.
    • The link opens in a new tab and is styled consistently with the other resource links.
    • No changes were made to the CLI or Python package.
  • Why:

    • Addresses and closes #318 by making token estimation more visible and accessible to users.
  • How to test:

    1. Start the server (cd src && uvicorn server.main:app --reload).
    2. Open the app in your browser.
    3. Scroll to the footer and verify the "Token Estimator" link appears and opens https://gitingest.com/tokencount in a new tab.

Screenshot

Screenshot 2025-06-29 205833


Closes #318

HmbleCreator avatar Jun 29 '25 15:06 HmbleCreator

@HmbleCreator Thanks, But this is just the link, it seems to me that https://github.com/cyclotruc/gitingest/issues/318 would require to actually implement the backend route for this new function, do you think you can work on this?

cyclotruc avatar Jun 30 '25 00:06 cyclotruc

@HmbleCreator Thanks, But this is just the link, it seems to me that #318 would require to actually implement the backend route for this new function, do you think you can work on this?

Thanks for pointing that out! Yes, I’d be happy to implement the backend route for token estimation as part of #318. I can add an endpoint (e.g. /api/estimate-tokens) that accepts raw text, estimates the token count using tiktoken or a similar utility, and returns the result. Let me know if you have a preferred response schema or want it namespaced differently; I'd be happy to get started.

HmbleCreator avatar Jun 30 '25 01:06 HmbleCreator

@HmbleCreator Thanks, But this is just the link, it seems to me that #318 would require to actually implement the backend route for this new function, do you think you can work on this?

Thanks for pointing that out! Yes, I’d be happy to implement the backend route for token estimation as part of #318. I can add an endpoint (e.g. /api/estimate-tokens) that accepts raw text, estimates the token count using tiktoken or a similar utility, and returns the result. Let me know if you have a preferred response schema or want it namespaced differently; I'd be happy to get started.

Are we only gonna have support for OpenAI models or other models also, like open source models available via HF?

HmbleCreator avatar Jun 30 '25 02:06 HmbleCreator

The token counting functionality uses two efficient tokenizer libraries:

  • tiktokenizer for OpenAI models - provides fast and accurate token counting for GPT models
  • autotiktokenizer for non-OpenAI models - enables efficient token counting across a wide range of open-source models

This dual approach ensures we can provide fast and accurate token counting regardless of the model being used, while keeping the implementation lightweight and efficient.

HmbleCreator avatar Jun 30 '25 09:06 HmbleCreator

I'll test it out in few hours.

I see that both logic and routing are defined and implemented within the entrypoint of the server, maybe move this to the "routers/" folder.

ix-56h avatar Jun 30 '25 12:06 ix-56h

Hi! I wanted to ask—does the UI theme/design you use for Gitingest have a name or is it based on a particular design system? I liked the style; it’s clean, modern, and playful! Additionally, I wanted to express my gratitude for your guidance and patience over the past two to three days. As a newbie, it was a great experience learning about FastAPI, backend/frontend separation, API best practices, and collaborative open-source workflows. I learned a great deal and truly appreciate the opportunity to contribute! Thanks again!

HmbleCreator avatar Jul 01 '25 03:07 HmbleCreator

Hi! I wanted to ask—does the UI theme/design you use for Gitingest have a name or is it based on a particular design system?

Yes, neobrutalism, you can find it at neobrutalism.com.

I wanted to express my gratitude for your guidance and patience over the past two to three days. As a newbie, it was a great experience learning about FastAPI, backend/frontend separation, API best practices, and collaborative open-source workflows. I learned a great deal and truly appreciate the opportunity to contribute! Thanks again!

You're welcome :)

ix-56h avatar Jul 01 '25 17:07 ix-56h

hey, is there any issue with the merging, any issue with code?

HmbleCreator avatar Jul 06 '25 02:07 HmbleCreator

@HmbleCreator i'm sorry, we're late on this one.

We currently have some urgent topic and we don't know if we still want to add a dedicated tiktoken feature to the frontend app.

I'll put this in draft for now.

ix-56h avatar Jul 25 '25 18:07 ix-56h

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Jul 27 '25 01:07 github-actions[bot]

This pull request has resolved merge conflicts and is ready for review.

github-actions[bot] avatar Aug 01 '25 02:08 github-actions[bot]

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Aug 05 '25 17:08 github-actions[bot]

Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale. If you’d like to keep it open, please leave a comment within 10 days. Thanks!

github-actions[bot] avatar Sep 20 '25 06:09 github-actions[bot]

This pull request has resolved merge conflicts and is ready for review.

github-actions[bot] avatar Sep 23 '25 05:09 github-actions[bot]

Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale. If you’d like to keep it open, please leave a comment within 10 days. Thanks!

github-actions[bot] avatar Nov 08 '25 06:11 github-actions[bot]

Hi there! We haven’t heard anything for 10 days, so I’m closing this pull request. Feel free to reopen if you’d like to continue working on it. Thanks!

github-actions[bot] avatar Nov 18 '25 06:11 github-actions[bot]