Downloads · 30 days
0
cordovank/productlens
productlens is a machine learning model from cordovank. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
ProductLens is a lightweight Gradio demo that helps you compare consumer products/services based on your priorities (privacy, price, ease of setup, etc.). It runs a simple agent pipeline:
Downloads · 30 days
0
Access
Public
Updated Jan 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.pyc18.1 KB · 45%
From the Hugging Face model README
ProductLens is a lightweight Gradio demo that helps you compare consumer products/services based on your priorities (privacy, price, ease of setup, etc.). It runs a simple agent pipeline:
User query → Planner Agent → Search Agent(s) (parallel) → Comparator Agent → UI
planner_agent.py: turns your query into a structured plan (ProductPlan)search_agent.py: calls a web_search tool and summarizes resultscomparator_agent.py: synthesizes a decision + markdown tablecomparison_manager.py: orchestrates the workflowload_vars.py: centralized provider/model configuration+----------------------------------------------------------------------------------+
| Hugging Face Space / Docker |
| |
| +---------------------------+ |
| | Gradio UI (7860) | |
| | - Textbox + Examples | |
| | - Streams status output | |
| +-------------+-------------+ |
| | user query |
| v |
| +---------------------------+ +---------------------------------------+ |
| | COMPARISON MANAGER | | Env Config | |
| | - trace_id + orchestration|<------| PROVIDER + MODEL + KEYS + N settings | |
| | - async generator output | +---------------------------------------+ |
| +-------------+-------------+ |
| | |
| | (1) PLAN: ProductPlan (JSON schema) |
| v |
| +---------------------------+ |
| | PLANNER AGENT | |
| | - pick N products | |
| | - derive criteria | |
| | - generate searches | |
| +-------------+-------------+ |
| | Runner.run() |
| v |
| +---------------------------+ |
| | LLM PROVIDER ROUTER | |
| | OpenAI / OpenRouter / | |
| | Ollama (ChatCompletions) | |
| +---------------------------+ |
| | |
| | (2) RESEARCH: parallel per-product |
| v |
| +-----------------------------------------+ |
| | Async Task Fan-out (asyncio.gather) | |
| | - one task per product | |
| +-------------------+---------------------+ |
| | |
| +-----------+---------------+-----------------------+---- ... |
| | | | |
| v v v |
| +--------------------+ +--------------------+ |
| | SEARCH AGENT | | SEARCH AGENT | ... |
| | tool_choice=req'd | | tool_choice=req'd | |
| +---------+----------+ +---------+----------+ |
| | tool call | tool call |
| v v |
| +-------------+ +-------------+ |
| | web_search | | web_search | (function_tool) |
| | (Ollama API)| | (Ollama API)| |
| +------+------+ +------+------+ |
| | | |
| v v |
| +-------------+ +-------------+ |
| | Web results | | Web results | |
| +------+------+ +------+------+ |
| | summary | summary |
| +-----------+----------+ |
| v |
| +---------------------------+ |
| | research_results[] | |
| | "product: summary" | |
| +-------------+-------------+ |
| | |
| | (3) COMPARE: decision + table |
| v |
| +---------------------------+ |
| | COMPARATOR AGENT | |
| | - normalize differences | |
| | - rank options | |
| | - output markdown table | |
| +-------------+-------------+ |
| | Runner.run() |
| v |
| +---------------------------+ |
| | Final Output -> Gradio UI | |
| | - Recommendation | |
| | - Comparison Table | |
| +---------------------------+ |
| |
+----------------------------------------------------------------------------------+
NUM_OF_PRODUCTS (default=2) and NUM_OF_SEARCHES (default=1) increases cost/latency and may exceed small context windows.Try prompts like: