update readme

This commit is contained in:
2026-01-20 20:21:47 -08:00
parent a33ad74580
commit 103b0ae3c2

View File

@@ -3,7 +3,7 @@
regspy is a regex pattern generator, you enter some data -> select what you want matched and or not matched -> ??? -> Pattern! regspy is a regex pattern generator, you enter some data -> select what you want matched and or not matched -> ??? -> Pattern!
![alt text](https://d1pz4mbco29rws.cloudfront.net/public/regspy.gif) ![regspy demo](https://d1pz4mbco29rws.cloudfront.net/public/regspy.gif)
This project started as me trying to learn dspy, its vibe coded to shit and back but it works and has some accomplishments: This project started as me trying to learn dspy, its vibe coded to shit and back but it works and has some accomplishments:
- Runs on small models with 3B parameter at a minimum, so it should run on anything. - Runs on small models with 3B parameter at a minimum, so it should run on anything.
@@ -36,7 +36,7 @@ But if you're a everyday smooth brain like me that needs a simple pattern on the
- **AutoHotkey v2.0** - [Download](https://www.autohotkey.com/) - **AutoHotkey v2.0** - [Download](https://www.autohotkey.com/)
- **Python Libs**: - **Python Libs**:
```bash ```bash
pip install dspy grex ollama pip install dspy grex ollama modaic
``` ```
- **Ollama**: - **Ollama**:
```bash ```bash
@@ -48,27 +48,6 @@ But if you're a everyday smooth brain like me that needs a simple pattern on the
AutoHotkey64.exe regspy.ahk # Or just double click regspy.ahk AutoHotkey64.exe regspy.ahk # Or just double click regspy.ahk
``` ```
### CLI flags
```bash
# Run test suite
python regexgen.py --test
# Pre-compile for faster runtime
python regexgen.py --compile
# Generate regex from JSON input
python regexgen.py input.json output.json
# With custom config
python regexgen.py input.json output.json --config config.json
# Dataset management
python regexgen.py --list-dataset output.json
python regexgen.py --add-example example.json
python regexgen.py --delete-example <index>
```
## Architecture ## Architecture
``` ```
@@ -91,3 +70,71 @@ The Config tab allows session-level adjustments:
- **Reward Threshold**: Stop early if score exceeds (default: 0.85) - **Reward Threshold**: Stop early if score exceeds (default: 0.85)
- **Scoring Weights**: Adjust the 5 criteria weights - **Scoring Weights**: Adjust the 5 criteria weights
- **Context Window** (`num_ctx`): Ollama context size (default: 8192). Ollama defaults to 4096 which can truncate prompts with many training examples. If you see "truncating input prompt" warnings in Ollama logs, bump this up. Uses ~200MB extra VRAM per 4K increase on 3B models. - **Context Window** (`num_ctx`): Ollama context size (default: 8192). Ollama defaults to 4096 which can truncate prompts with many training examples. If you see "truncating input prompt" warnings in Ollama logs, bump this up. Uses ~200MB extra VRAM per 4K increase on 3B models.
## Modaic Hub
RegSpy uses Modaic's `PrecompiledProgram` so you can publish and load programs with bundled prompts, config, and optionally code.
### Push to Modaic Hub
Use the helper script:
```bash
uv run push.py your-username/regspy --with-code
```
Or directly in Python:
```python
from regspy import RegexConfig, RegexProgram
program = RegexProgram(RegexConfig())
program.push_to_hub("me/regspy", with_code=True)
```
### DSPy Programs: Auto Classes
Load a program:
```python
from modaic import AutoProgram
program = AutoProgram.from_precompiled("raet/regspy")
```
Load a config:
```python
from modaic import AutoConfig
config = AutoConfig.from_precompiled("raet/regspy")
```
Override a config:
```python
from modaic import AutoProgram
program = AutoProgram.from_precompiled(
"raet/regspy",
config={"use_cot": False, "temperature": 0.2},
)
```
Specify runtime parameters:
```python
from modaic import AutoProgram
program = AutoProgram.from_precompiled("raet/regspy", timeout=60)
```
Load a specific revision:
```python
from modaic import AutoProgram
program = AutoProgram.from_precompiled("raet/regspy", rev="dev")
program = AutoProgram.from_precompiled("raet/regspy", rev="v1.0")
program = AutoProgram.from_precompiled("raet/regspy", rev="918ad95")
```