Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
TypeScript library for Local LLM in Chromium browsers
| Date | Stars |
|---|---|
| 2026-07-31 | 265 |
| 2026-08-06 | 265 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Simple Chromium AI
A lightweight TypeScript wrapper for Chrome's built-in AI APIs (Prompt, Translator, Language Detector, and Summarizer) that trades flexibility for simplicity and type safety.
## Why Use This?
Chrome's native AI APIs are powerful but require careful initialization and session management. This wrapper provides:
- **Parse, don't validate** - Initialization ensures the model is downloaded and returns an object you _must_ use, making it impossible to skip the readiness check
- **Automatic error handling** - Graceful failures with clear messages
- **Simplified API** - Common tasks in one method call
- **Safe API variant** - Result types instead of throwing
For advanced use cases requiring more control, use the [original Chrome AI APIs](https://developer.chrome.com/docs/ai/built-in-apis) directly.
## Quick Start
```bash
npm install simple-chromium-ai
```
Every API requires initialization before use. Init triggers the model download and returns an object with the API methods:
```javascript
import { initLanguageModel, initTranslator, initDetector, initSummarizer } from 'simple-chromium-ai';
const ai = await initLanguageModel("You are a helpful assistant");
const response = await ai.prompt("Write a haiku");
const translator = await initTranslator({ sourceLanguage: "en", targetLanguage: "es" });
const translated = await translator.translate("Hello");
const detector = await initDetector();
const detections = await detector.detect("Bonjour le monde");
const summarizer = await initSummarizer({ type: "tldr" });
const summary = await summarizer.summarize("Long article...");
```
## Prerequisites
- Chrome 138+ for Translator, Language Detector, and Summarizer APIs
- Chrome 148+ for Prompt API
- See [hardware requirements](https://developer.chrome.com/docs/ai/get-started#hardware) — models are downloaded on-device (~4GB)
## Prompt API
### Initialize
```typescript
const ai = await initLanguageModel(
systemPrompt?: string,
expectedInputLanguages?: string[], // defaults to ["en"]
expectedOutputLanguages?: string[] // defaults to ["en"]
);
```
The `expectedInputLanguages` parameter tells Chrome what language(s) the user prompts will be in. The `expectedOutputLanguages` parameter tells Chrome what language(s) the model should output.
### Prompt
```typescript
const response = await ai.prompt(
"Your prompt",
timeout?: number,
promptOptions?: LanguageModelPromptOptions, // signal, responseConstraint, etc.
sessionOptions?: LanguageModelCreateOptions
);
```
### Session Management
```typescript
// Create reusable session (maintains conversation context)
const session = await ai.createSession();
const response1 = await session.prompt("Hello");
const response2 = await session.prompt("Follow up");
session.destroy();
// Override the instance's system prompt for this session
const customSession = await ai.createSession({
initialPrompts: [{ role: 'system', content: 'You are a pirate' }]
});
// Or use withSession for automatic cleanup
const result = await ai.withSession(async (session) => {
return await session.prompt("Hello");
});
```
### Token Management
```typescript
const usage = await ai.checkTokenUsage("Long text...");
if (!usage.willFit) {
// Prompt is too long for the context window
}
```
### Structured Output
```javascript
const response = await ai.prompt(
"Analyze the sentiment: 'I love this!'",
undefined,
{ responseConstraint: {
type: "object",
properties: {
sentiment: { type: "string", enum: ["positive", "negative", "neutral"] },
confidence: { type: "number" }
},
required: ["sentiment", "confidence"]
}}
);
const result = JSON.parse(response);
```
### Cancellation
```javascript
const controller = new AbortController();
const response = await ai.prompt(
"Write a detailed analysis...",
undefined,
{ signal: controller.signal }
);
// Cancel from elsewhere:
controller.abort();
```
## Translator API
```typescript
import { initTranslator } from 'simExcerpt of 8,827 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e36e1d20e64f2f3b, llm:repository description: 'TypeScript library for Local LLM in Chromium browsers'; topics include 'local-llm', 'gemini-nano-in-chrome', 'browser-extension', 'chrome-extension', 'chromium', 'typescript'.
matched fp:e36e1d20e64f2f3b, llm:repository description: 'TypeScript library for Local LLM in Chromium browsers'; topics include 'local-llm', 'gemini-nano-in-chrome', 'browser-extension', 'chrome-extension', 'chromium', 'typescript'.