IdeaCredIdeaCred

burgerkhan6227/tokenWise-Optimizer

56

๐ŸŽฏ Optimize LLM token usage by 70-90% with smart context ranking, reducing costs while maintaining quality and performance.

What's novel

๐ŸŽฏ Optimize LLM token usage by 70-90% with smart context ranking, reducing costs while maintaining quality and performance.

Code Analysis

15 files read ยท 4 rounds

A FastAPI service that takes a query and a list of context items, chunks them, ranks them by relevance using OpenAI embeddings plus keyword/recency/relationship scoring, then selects the best subset within a token budget โ€” essentially a relevance-based context filter for LLM prompts.

Strengths

The pipeline architecture (chunk โ†’ rank โ†’ select โ†’ reorder) is cleanly separated into distinct modules with clear responsibilities, and the MMR diversity selection strategy shows some algorithmic thought. The code is readable with consistent naming and reasonable docstrings throughout.

Weaknesses

Multiple bugs break core functionality (broken import in /index endpoint, cache key bug in embed_batch, camelCase example vs snake_case API), synchronous OpenAI calls block the async event loop, the vector store is dead code in the main pipeline, and the README is wildly misleading (describes a GUI desktop app with .exe/.dmg downloads when it's actually a Python API library).

Score Breakdown

Innovation
4 (25%)
Craft
59 (35%)
Traction
8 (15%)
Scope
51 (25%)

Signal breakdown

Innovation

Not Fork+1
Code Novelty+1
Concept Novelty+1

Craft

Ci-1
Tests+5
Polish+1
Releases+0
Has License+5
Code Quality+15
Readme Quality+15
Recent Activity+7
Structure Quality+5
Commit Consistency+2
Has Dependency Mgmt+5

Traction

Forks+0
Stars+6
Hn Points+0
Watchers+0
Early Traction+0
Devto Reactions+0
Community Contribs+2

Scope

Commits+5
Languages+5
Subsystems+10
Bloat Penalty+0
Completeness+7
Contributors+6
Authored Files+12
Readme Code Match+3
Architecture Depth+3
Implementation Depth+8

Evidence

Commits

14

Contributors

2

Files

30

Active weeks

3

TestsCI/CDREADMELicenseContributing

Repository

Language

Python

Stars

2

Forks

0

License

MIT