@nan0web/ui-llm
v1.0.1
Published
LLM Protocol layer for NaN•Web — Sessions, Drivers, Models, Streaming. One Logic — Many UI.
Maintainers
Readme
@nan0web/ui-llm 🧠
LLM Protocol layer for NanoWeb. Sessions, Drivers, Models, Streaming.
Architecture
Core Exports
LLiMoSession— manages a conversation session with an LLMLLiMoMessage— message format (role, content, metadata)LLiMoResponse— structured response from LLMLLiMoDriver— provider-specific driver (Cerebras, HuggingFace, OpenAI, Google)LLiMoContact— contact information for LLM endpointModel— model metadata and capabilitiesCliChat— CLI chat abstraction
Philosophy: Chat as the Universal Base
In the One Logic — Many UI strategy, the Chat/LLM interface serves as the primary abstraction for all sequential interactions.
- Voice is simply a Chat where text is transported via audio (STT/TTS)
- Forms are decomposed into a sequence of Chat messages (Input → Reply → Validation → Next)
Component Mapping (CLI → LLM)
| CLI Component | LLM Translation | | :------------------------ | :-------------------------------------------------------- | | Select / Autocomplete | Choice buttons, numbered list, or natural language intent | | Confirm | Yes/No quick replies | | Tree / Navigation | Drill-down messages or breadcrumb-labeled options | | Table | Paginated lists or summarized data cards | | Alert / Toast | System notification messages with level-based styling |
Installation
How to install with npm?
npm install @nan0web/ui-llmHow to install with pnpm?
pnpm add @nan0web/ui-llmUsage
Session
Session manages the chat sequence.
How to create a LLiMoSession instance?
import { LLiMoSession } from '@nan0web/ui-llm'
const session = new LLiMoSession()
console.info(typeof session)Java•Script
Uses d.ts files for autocompletion
API
All exported classes should pass basic test to ensure API examples work
Contributing
How to contribute? - check here
License
How to license? - ISC LICENSE file.
