Aster Vale commited on
Commit
0161d7a
·
1 Parent(s): 5831832

fix: README.yaml metadata for HF Spaces

Browse files
Files changed (1) hide show
  1. README.md +33 -52
README.md CHANGED
@@ -1,67 +1,48 @@
1
- # LoomLens Live — Standalone Package
2
-
3
- **Location:** `signal-loom-loomlens/`
4
- **Status:** Phase 1–3 built. Packaging for release TBD.
5
-
6
  ---
 
 
 
 
 
 
 
 
 
 
7
 
8
- ## What's Built
9
 
10
- | File | Phase | Description |
11
- |------|-------|-------------|
12
- | `loomlens-models.ts` | 1 | Model registry — 12 models across 5 tiers with live pricing |
13
- | `loomlens-engine.ts` | 1 | Token estimator + task detection + cost calculator + fit scorer |
14
- | `loomlens-panel.tsx` | 2 | React pre-flight panel with model cards + tip footer |
15
- | `loomlens-openclaw-plugin.ts` | 3 | OpenClaw plugin with `before_model_resolve` hook + routes |
16
 
17
- ## Quick Start (Engine only — no UI)
18
 
19
- ```ts
20
- import { estimatePrompt } from './loomlens-engine';
21
 
22
- const result = estimatePrompt(
23
- 'Write a function that parses JSON and handles errors gracefully',
24
- 'minimax/MiniMax-M2'
25
- );
 
26
 
27
- console.log(result.estimates[0].estimatedCost); // $0.0012
28
- console.log(result.recommended?.modelName); // 'Claude Sonnet 4'
29
- console.log(result.tip); // 'Using MiniMax M2...'
30
- ```
31
 
32
- ## Architecture
33
 
34
- ```
35
- ┌─────────────────────────────────────────────┐
36
- │ LoomLensEngine (engine.ts) │
37
- │ ┌──────────────┐ ┌────────────────────┐ │
38
- │ │ TokenEstimator│ │ TaskTypeDetector │ │
39
- │ │ (char heuristics)│ │ (keyword analysis │ │
40
- │ └──────────────┘ └────────────────────┘ │
41
- │ ┌──────────────┐ ┌────────────────────┐ │
42
- │ │ CostCalculator│ │ FitScorer │ │
43
- │ │ ($/token × tp │ │ (capability match) │ │
44
- │ └──────────────┘ └────────────────────┘ │
45
- └────────────────────┬──────────────────────┘
46
- │ LoomLensResult
47
- ┌────────────┼────────────┐
48
- ▼ ▼ ▼
49
- LoomLensPanel /loomlens POST /loomlens/override
50
- (React UI) (cmd) → before_model_resolve hook
51
- ```
52
 
53
- ## Integration with Existing LoomLensAI-Live
54
 
55
- The existing `signal-loom-live/panel.html` is a **post-hoc tracker** (shows cumulative cost after prompts fire).
56
- LoomLens Live (`signal-loom-loomlens/`) is a **pre-flight estimator** (shows alternatives before you send).
57
 
58
- They are complementary and can coexist. The OpenClaw plugin bridges them.
59
 
60
- ## Next Steps
 
 
61
 
62
- 1. **Package** — add `package.json` + build step (tsc → JS bundle)
63
- 2. **Test** — add unit tests for token estimation accuracy
64
- 3. **Install plugin** — copy to `~/.openclaw/plugins/loomlens/`
65
- 4. **Panel injection** — mount `loomlens-panel.tsx` into OpenClaw webchat DOM
66
- 5. **Live pricing** — wire OpenRouter API for real-time pricing instead of static registry
67
 
 
 
 
 
 
 
 
1
  ---
2
+ title: LoomLensAI — Token Budget Calculator
3
+ emoji: ⚡
4
+ colorFrom: purple
5
+ colorTo: purple
6
+ sdk: static
7
+ app_file: index.html
8
+ pinned: false
9
+ ---
10
+
11
+ # LoomLens AI™ — Token Budget Calculator
12
 
13
+ **One prompt. Every model. Every cost. Before you run.**
14
 
15
+ ⚡ Find the best model to fit your prompt — free, 5 estimates/day.
 
 
 
 
 
16
 
17
+ ---
18
 
19
+ ## Features
 
20
 
21
+ - **19+ AI models** across 3 cost tiers
22
+ - **Real-time token estimation** — input + cached + output
23
+ - **Live cost comparison** — see exactly what each model costs before you run
24
+ - **LoomToken balance** — connect your API key to see credit balance and charges
25
+ - **Savings calculator** — shows how much you save vs. the most expensive option
26
 
27
+ ---
 
 
 
28
 
29
+ ## How It Works
30
 
31
+ 1. Paste your prompt
32
+ 2. Select models to compare
33
+ 3. Click **Estimate Cost**
34
+ 4. See exact cost per run for every model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ ---
37
 
38
+ ## LoomTokens
 
39
 
40
+ Connect your API key to use pay-per-call estimates:
41
 
42
+ - **100 LoomTokens** per estimate call = **$0.10**
43
+ - Purchase credit packs: $5 (5,000) · $10 (10,000) · $25 (25,000) · $50 (50,000) · $100 (100,000)
44
+ - Balance updates automatically after each call
45
 
46
+ ---
 
 
 
 
47
 
48
+ Built by [Signal Loom AI](https://signalloomai.com) · [API Docs](https://signalloomai.com/docs)