SShortSingh.
Back to feed

Developer builds zero-cost, fully on-device AI chat widget using three-tier fallback system

0
·1 views

A developer has published a technical guide on DEV Community detailing how to build an AI chat widget that runs entirely within the user's browser, incurring no per-query API costs. The system uses a three-tier fallback: Chrome's built-in Gemini Nano model when available, MiniLM semantic search via Transformers.js as a secondary option, and basic keyword matching as a last resort. All processing stays on the user's device, meaning no conversation data is sent to external servers, addressing privacy concerns common with server-side AI integrations. To avoid unnecessary resource use, the widget delays loading models and knowledge base files until a visitor actively opens the chat panel. Each response is visibly labeled with the tier that generated it, and Nano outputs are filtered to strip markdown and URLs before display.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds live registry tracking 750+ MCP servers across GitHub

A developer has launched kiprio.com/mcp-registry, a daily-updated registry that indexes, categorises, and ranks over 750 Model Context Protocol (MCP) servers sourced from GitHub and community lists. MCP, which allows AI assistants like Claude to connect to databases, APIs, and file systems, has grown rapidly over the past six months with no centralised discovery tool available. The registry reveals that Python and TypeScript each account for roughly a third of all servers, with Python favoured for data-heavy integrations and TypeScript leading in production-quality implementations. Analysis of the indexed servers shows significant redundancy — with over 40 weather servers and 30-plus web search wrappers — alongside genuinely useful tools for database querying, GitHub workflows, and niche use cases like Ethereum data and betting markets. A free public API is available for searching and retrieving server data, with a paid Pro tier offering bulk access and webhook notifications.

0
ProgrammingDEV Community ·

How to manage local and staging domains cleanly using hosts file profiles

Developers frequently end up with cluttered /etc/hosts files containing conflicting entries for the same hostname across local, staging, and cutover environments. A practical solution involves maintaining separate hosts profile files in a dedicated directory and activating only one at a time by copying it over the system hosts file. A simple shell script can automate this process, backing up the existing hosts file with a timestamp and flushing the DNS cache after each switch. For setups requiring shared base entries alongside project-specific overrides, profiles can be concatenated using cat and tee before applying. This approach is recommended until more complex tooling like dnsmasq or CoreDNS becomes necessary for wildcard domains or team-wide dynamic DNS needs.

0
ProgrammingDEV Community ·

RegionCheck Launches Tool to Test Endpoints Across AWS, Azure, and Google Cloud

A developer has launched RegionCheck, a new platform that allows engineers to test and monitor endpoints from cloud regions across AWS, Azure, and Google Cloud without setting up any infrastructure. The tool supports HTTP testing, DNS lookups, TLS certificate validation, continuous monitoring with alerts, and side-by-side comparisons across providers. It was built to address the lack of a single unified tool for diagnosing issues like uneven DNS propagation, CDN caching problems, and regional latency differences. RegionCheck is aimed at DevOps engineers, SREs, platform engineers, and backend developers who work with cloud infrastructure. The platform is available at regioncheck.io, with free checks open to all visitors and additional features accessible via a registered account.

0
ProgrammingDEV Community ·

A Safer Workflow for Editing /etc/hosts Without Breaking Local Dev Setups

Editing /etc/hosts is a common practice for local development, but mistakes like duplicate entries or skipped DNS flushes can cause hard-to-debug issues. A recommended approach involves maintaining a personal copy of the hosts file, backing up the live system file before overwriting it, and applying changes deliberately rather than editing the system file directly. After copying the updated file to the system path, developers should flush DNS using the appropriate command for their OS — macOS, Windows, or Linux — and verify resolution via terminal before opening a browser. Keeping only one active mapping per hostname and confirming changes in the terminal first helps separate hosts-related bugs from application-level issues. For teams, committing a hosts.example file and a simple apply script to the repository can prevent configuration drift and speed up onboarding.

Developer builds zero-cost, fully on-device AI chat widget using three-tier fallback system · ShortSingh