explaingit

zanwei/chatgpt-model-selector

Analysis updated 2026-05-18

46JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A reusable five-tier model intelligence picker UI, styled after ChatGPT's model selector, available as a JavaScript Web Component and a SwiftUI package.

Mindmap

mindmap
  root((repo))
    What it does
      Model tier picker
      Five intelligence levels
    Tech stack
      JavaScript
      SwiftUI
      Swift
    Use cases
      Web apps
      iOS and macOS apps
    Audience
      Frontend developers
      iOS developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Drop a ChatGPT-style model tier picker into a web page as a single custom HTML element

USE CASE 2

Add a native iOS or macOS model selection control to a SwiftUI app

USE CASE 3

Reuse the five-tier magnetic-snap interaction pattern in another AI product's UI

What is it built with?

JavaScriptSwiftUISwiftWeb Components

How does it compare?

zanwei/chatgpt-model-selectorfubak/ultraswarmmodernizr/the-old-modernizr.com
Stars464646
LanguageJavaScriptJavaScriptJavaScript
Last pushed2019-11-15
MaintenanceDormant
Setup difficultyeasymoderateeasy
Complexity2/54/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This project recreates the model-intelligence picker interface from ChatGPT as a reusable UI component, built in two separate versions that share the same look and behavior. One version is a JavaScript Web Component that runs directly in any modern browser with no external dependencies. The other is a SwiftUI package for iOS 17 and newer, or macOS 14 and newer, aimed at native Apple app developers. Both versions offer the same five selectable intelligence tiers: Light, Medium, High, Extra High, and Ultra. Dragging the selector snaps between tiers with a spring-like magnetic pull, the color shifts smoothly from cyan to violet as you move up the tiers, and picking the top Ultra tier triggers a small celebration animation. The component also respects a user's reduced-motion accessibility setting by toning down or skipping the animation. The JavaScript version can be dropped into a page as a custom HTML element, chatgpt-model-selector, with attributes for the model name shown and the starting tier value. It fires a standard change event containing the selected index, tier name, and model whenever the user picks a new tier. It works in browsers that support Web Components, Shadow DOM, Canvas 2D, and the ResizeObserver API. The SwiftUI version is installed as a Swift package through Xcode's package manager or by editing Package.swift directly, then used as a ModelSelector view bound to a state variable holding the current tier. A native demo app is included and can be run either through Xcode or from the command line with Swift's package runner. Beyond the picker itself, the project includes accessibility support such as VoiceOver labeling and Dynamic Type on the Apple side, automated tests covering the tier logic and geometry, and continuous integration checks for both the Swift and JavaScript code. The README is explicit that this is an independent, ChatGPT-inspired interface experiment with no affiliation to or endorsement from OpenAI. It is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me how to embed the chatgpt-model-selector Web Component in my HTML page and listen for tier changes
Prompt 2
Help me add the SwiftUI ModelSelector package to my Xcode project and bind it to state
Prompt 3
Explain how the magnetic snapping and color progression animation works in this component

Frequently asked questions

What is chatgpt-model-selector?

A reusable five-tier model intelligence picker UI, styled after ChatGPT's model selector, available as a JavaScript Web Component and a SwiftUI package.

What language is chatgpt-model-selector written in?

Mainly JavaScript. The stack also includes JavaScript, SwiftUI, Swift.

What license does chatgpt-model-selector use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is chatgpt-model-selector to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is chatgpt-model-selector for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.