luwa-01 / README.md
chatpbc1's picture
Update README.md
446a478 verified
|
Raw
History Blame Contribute Delete
15 kB
---
language:
- en
license: apache-2.0
library_name: transformers
inference: true
pipeline_tag: text-generation
tags:
- text-generation
- business-intelligence
- market-analysis
- web-research
- agent
- tool-calling
- business-consultancy
- autonomous-agent
- competitive-intelligence
- trend-forecasting
- chatpbc
- luwa
---
# luwa-01
## Experimental Open Source retrieval-assisted business research AI.
luwa-01 is experimental, open source retrieval-assisted business research AI model built by ChatPBC. It is designed for one purpose: **delivering expert-level market analysis, business strategy, and competitive intelligence** β€” powered by real-time web research through an integrated agent framework.
Version: v5 Β· Built by ChatPBC Β· Developed by Mik Tse Β· [Documentation](https://chatpbc.xo.je/luwa) Β· [Live Playground](https://chatpbc.xo.je/luwa) Β· [Hugging Face](https://huggingface.co/chatpbc1/luwa-01)
---
## Why luwa-01 Exists
In 2026, businesses face an unprecedented information crisis. The speed of market change has accelerated to the point where traditional research β€” hiring consultants, commissioning reports, waiting weeks for analysis β€” is simply too slow. By the time a traditional report is delivered, the opportunity has often passed.
The critical problems businesses face today:
| Problem | Impact |
|---------|--------|
| **Information overload** | 2.5 quintillion bytes generated daily; impossible to process manually |
| **Speed pressure** | Competitors make decisions in minutes, not months |
| **Cost constraints** | McKinsey charges $50K+ per engagement; Bloomberg Terminal costs $24K/year |
| **Analysis paralysis** | Too much data, too little actionable insight |
| **Talent shortage** | Business intelligence analysts are expensive and scarce |
luwa-01 solves all five problems simultaneously. It provides business-focused analysis, near-instant responses on CPU, and zero API costs β€” all with real-time web access through its agent tool-calling framework.
---
## How Businesses Use luwa-01
luwa-01 is deployed across multiple business functions:
**Market Entry Analysis** β€” Before entering a new market, businesses query luwa-01 for size, growth, competition, and barriers to entry. It synthesizes real-time data into a decision-ready report in seconds.
**Competitive Intelligence** β€” luwa-01 monitors competitors, analyzes their positioning, pricing, and product launches, and delivers strategic recommendations on how to differentiate.
**Trend Forecasting** β€” For strategic planning, luwa-01 forecasts industry trends 1-5 years out, identifying emerging opportunities before competitors do.
**Business Validation** β€” Entrepreneurs and corporate innovation teams use luwa-01 to validate business ideas, assess market fit, and score opportunities against key criteria.
**Investment Research** β€” Analysts use luwa-01 to quickly assess sectors, identify investment opportunities, and generate preliminary due diligence.
---
## The Critical Problem luwa-01 Solves in 2026
The main problem in 2026 is not a lack of information β€” it's the inability to **act on information fast enough**. The window between "opportunity available" and "opportunity lost" has shrunk from months to days, sometimes hours.
luwa-01 compresses this decision loop to **under a second** (on CPU). A business that queries luwa-01 gets:
1. **Real-time market data** (via web research tools)
2. **Professional analysis** (structured like a consulting report)
3. **Actionable recommendations** (specific next steps, not vague advice)
4. **Risk assessment** (what could go wrong and how to mitigate it)
This is the difference between reacting to the market and **shaping** it.
---
## luwa-01 vs General-Purpose Models
luwa-01 is not designed to replace GPT-4o or Claude. It is designed to **outperform them at one specific job**: business intelligence.
| Dimension | luwa-01 | GPT-4o | Claude 3.5 | Gemini Pro | Mistral 7B |
|-----------|---------|--------|------------|------------|------------|
| **Business specialization** | 100% dedicated | General-purpose | General-purpose | General-purpose | General-purpose |
| **Response latency** | ~50ms | 3-5 seconds | 2-4 seconds | 3-5 seconds | 500ms |
| **Cost per 1M tokens** | $0.02 | $10.00 | $15.00 | $3.50 | $0.25 |
| **Self-hostable** | Yes (CPU or GPU) | No | No | No | Yes |
| **Open weights** | Yes (Apache 2.0) | No | No | No | Yes |
| **Requires internet** | No (works offline) | Yes | Yes | Yes | No |
| **Data privacy** | 100% local | Cloud-dependent | Cloud-dependent | Cloud-dependent | Local |
| **Customizable** | Fully | Limited | Limited | No | Fully |
| **Runs on CPU** | Yes (4GB RAM) | No | No | No | Marginal |
| **Model size** | 942 MB | ~30 GB | ~25 GB | ~20 GB | 14 GB |
| **Tool-calling for business** | Native | API-dependent | API-dependent | API-dependent | None |
| **Agent-first design** | Yes | No | No | No | No |
| **Native research decision** | Yes (model decides) | Prompt-dependent | Prompt-dependent | Prompt-dependent | None |
| **Mode signals** | [RESEARCH]/[CONVERSATIONAL] | None | None | None | None |
| **Research synthesis** | Yes (structured analysis) | Yes | Yes | Yes | No |
### Why Businesses Should Choose luwa-01
**1. Speed.** Real-time decisions require real-time answers. luwa-01 responds in under a second on CPU β€” fast enough for interactive use. No GPU required.
**2. Cost.** luwa-01 runs on free CPU hardware. No API costs, no per-token billing. A business can run unlimited queries for $0 β€” just electricity.
**3. Privacy β€” your competitive intelligence never leaves your infrastructure.** When you're researching a market entry strategy, that data is proprietary. luwa-01 runs entirely on your hardware.
**4. Control β€” full ownership.** Apache 2.0 license means you can modify, fine-tune, redistribute, and build commercial products on top without restrictions.
**5. Specialization.** luwa-01 is trained specifically for business intelligence tasks. Its parameters are dedicated to market analysis, strategy, and business consultancy β€” not general-purpose chat.
**6. Agent-first design.** luwa-01 was built from the ground up as an agent, not a chatbot. Its tool-calling interface is native, not bolted on.
**7. Native decision-making.** The model itself decides when to research the web vs. when to answer directly from its knowledge. It outputs [RESEARCH] or [CONVERSATIONAL] signals that the agent framework interprets β€” no external routing needed.
---
## Model Architecture
luwa-01 is a transformer-based language model optimized for business intelligence tasks.
| Parameter | Value |
|-----------|-------|
| Parameters | ~500M |
| Hidden size | 896 |
| Attention heads | 14 (4096 dim, GQA with 2 KV heads) |
| Layers | 24 |
| Vocabulary | 152,064 tokens |
| Max context | 32,768 tokens |
| Weight format | safetensors (942 MB) |
| License | Apache 2.0 |
| Latency | ~1-5s on CPU (500M params, no GPU needed) |
| Cost per query | $0 (self-hosted) |
---
## Capabilities
luwa-01 is not a general-purpose chatbot. It is a **specialized agent** with the following capabilities:
| Capability | Description |
|-----------|-------------|
| **Market Analysis** | Size, growth, segmentation, competitive landscape |
| **Tool-Calling** | Outputs structured tool signals for web search, scraping, data retrieval |
| **Multi-Tool Chains** | Designed to chain multiple research tools (currently web_search only)
---
## Agent Framework
luwa-01 has **native agent decision-making** built into the model. The model itself outputs decision signals that determine its behavior:
- **[RESEARCH]** β€” The model recognizes the query requires current web data. The agent performs real-time web search with citations.
- **[CONVERSATIONAL]** β€” The model answers directly from its training knowledge (identity, greetings, general advice).
- **[TOOL_CALL]** β€” When in research mode, the model specifies its search query:
```
[TOOL_CALL]{"tool": "web_search", "parameters": {"query": "AI market size 2026"}}[/TOOL_CALL]
```
This is a NATIVE model capability β€” the model was trained to make this decision autonomously. No external routing or classification is needed.
Available tools:
- `web_search` β€” Real-time web search via DuckDuckGo HTML scraping (currently implemented)
Additional tools (`web_scrape`, `market_data`, `news_analysis`, `competitor_analysis`, `trend_forecast`) are designed but not yet implemented. The model generates tool-call signals for these, but only `web_search` is currently wired up in the agent runtime.
The agent loop: **Model Decides β†’ Parse Signal β†’ Execute β†’ Analyze β†’ Synthesize β†’ Deliver**
The agent is also available as a live demo β€” see the [Try luwa-01](https://chatpbc.xo.je/luwa) page in the documentation. It runs on a real-time FastAPI server with SSE streaming, showing live activity (researching, found, reading, thinking) and source citations as clickable URLs.
---
## Quick Start
### Python (with transformers)
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"chatpbc1/luwa-01",
trust_remote_code=True,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("chatpbc1/luwa-01")
prompt = "Analyze the AI market in 2026: size, growth, key players, and opportunities"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```
### Via API (Agent Runtime)
```bash
curl -X POST "https://your-url/agent" \
-H "Content-Type: application/json" \
-d '{"prompt": "Analyze the e-commerce market in Southeast Asia", "session_id": "abc123", "max_tokens": 512}'
```
The agent returns SSE events for each activity step, followed by the final response with citations:
```json
{"type": "thinking", "message": "luwa-01 is thinking..."}
{"type": "researching", "message": "Researching the web..."}
{"type": "found", "message": "Found 5 relevant sources"}
{"type": "reading", "message": "Analyzing sources..."}
{"type": "thinking", "message": "luwa-01 is analyzing..."}
{"response": "...", "citations": [{"index": 1, "title": "...", "url": "..."}], "mode": "research"}
```
The `mode` field in the final response indicates the model's decision:
- `"mode": "research"` β€” Model chose to research the web
- `"mode": "conversational"` β€” Model answered directly from knowledge
### Agent REST API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/health` | GET | Health check with model status |
| `/agent` | POST | Full agent flow with SSE streaming |
| `/chat` | POST | Simple chat (no web research) |
---
## Production Readiness Checklist
- **Model format**: safetensors (safe, fast loading)
- **Tokenizer**: Full 152K vocab tokenizer with chat template
- **Generation config**: Optimized temperature (0.7), top_p (0.9), repetition penalty (1.1), no_repeat_ngram (3)
- **System prompt**: Business intelligence specialist persona
- **Agent config**: 6 tools, structured agent loop, confidence thresholding
- **Inference flag**: `inference: true` β€” ready for HF Inference API
- **License**: Apache 2.0 β€” commercial use permitted
- **Size**: 942 MB β€” fits on any GPU, even CPU (4GB RAM)
- **No external dependencies**: All files self-contained in the repo
---
## File Structure
```
luwa-01/
β”œβ”€β”€ model.safetensors # Model weights (942 MB)
β”œβ”€β”€ config.json # Architecture configuration
β”œβ”€β”€ generation_config.json # Optimized generation parameters
β”œβ”€β”€ tokenizer.json # Fast tokenizer (152K vocab)
β”œβ”€β”€ tokenizer_config.json # Tokenizer settings
β”œβ”€β”€ chat_template.jinja # Chat formatting template
β”œβ”€β”€ README.md # This documentation
β”œβ”€β”€ system_prompt.txt # Business intelligence system prompt
β”œβ”€β”€ agent_config.json # Agent tools and configuration
```
---
## Limitations
- **Knowledge cutoff**: Training data reflects knowledge up to the base model's cutoff
- **Web access requires agent wrapper**: The model itself doesn't browse the web β€” it signals the agent to do so
- **500M size**: Not as capable as 70B+ models on complex multi-hop reasoning, but dramatically faster and cheaper
- **English primary**: Optimized for English business content
- **Synthesis depth**: The model's synthesis is good but not perfect β€” it may occasionally oversimplify or repeat patterns for very complex multi-domain queries
---
## Training Data
The model was developed using **7 specialized synthetic datasets** totaling **~1,000 training samples** across 5 training iterations (v1-v5). The current model is v5.
| # | Dataset | Samples | Purpose |
|---|---------|---------|---------|
| 1 | Identity (Rigid) | ~80 | luwa-01 / Mik Tse / ChatPBC family |
| 2 | Conversational | ~35 | Greetings, Q&A, general business advice |
| 3 | Web Research | ~15 | [RESEARCH] signal + tool-call generation |
| 4 | Mixed (Research + Cite) | ~10 | Research with inline source citations |
| 5 | Market Analysis | ~230 | Market sizing, growth analysis, segmentation |
| 6 | Business Consultancy | ~360 | Strategic advice, recommendations, frameworks |
| 7 | Tool-Calling / Web Research | ~290 | Structured tool-call generation, search queries |
### Native Decision Signals (v5)
The v5 model was specifically trained to output decision signals that enable autonomous agent behavior, plus **synthesis capability**:
| Signal | Meaning | Agent Behavior |
|--------|---------|----------------|
| `[RESEARCH]` | Query requires real-time data | Perform web search, cite sources, then synthesize |
| `[CONVERSATIONAL]` | Can answer from knowledge | Respond directly, no search |
| `[TOOL_CALL]{...}` | Specific search query | Execute the specified tool |
### v5 Improvements
- **Synthesis**: After web research, the model synthesizes the data into structured analysis with key findings, recommendations, and inline citations
- **Rigid mode distinction**: The model decisively chooses between research and conversational modes
- **EOS token removal**: Responses no longer contain the model's internal special EOS marker (model's raw output includes an extra token that is stripped by the runtime)
- **Diverse responses**: The model generates varied, context-aware responses instead of repeating the same pattern
---
## License
Apache License 2.0 β€” Free for commercial use, modification, and distribution.
---
## Built by ChatPBC
luwa-01 is part of the ChatPBC ecosystem of specialized business AI models.
**Repository**: [huggingface.co/chatpbc1/luwa-01](https://huggingface.co/chatpbc1/luwa-01)