SomeTools

Regex Generator

Generate regular expressions from natural language descriptions using AI. Powered by WebLLM - runs entirely in your browser.

⚠️ Important: WebLLM Requirements (click to expand)

WebLLM requires WebGPU support in your browser.

  • WebGPU Support: Required for model execution. Check support at webgpureport.org
  • Browser Requirements: Chrome 113+, Edge 113+, or Safari 18+ (with WebGPU enabled)
  • GPU: A compatible GPU (dedicated or integrated) is recommended for best performance
  • AI Models: Large files (ranging from ~300MB to several GB) that need to be downloaded
  • Models are cached in your browser's IndexedDB for faster subsequent use
  • Some models may exceed your browser's default cache limit
How to increase browser cache size
  • Chrome/Edge: Settings → Site settings → Storage → Increase quota
  • Firefox: about:config → search "dom.storage.max_quota" → increase value
  • Safari: Preferences → Advanced → Show Develop menu → Develop → Empty Caches (then increase in Develop menu)
Troubleshooting WebLLM Issues
  • WebGPU errors: WebLLM requires WebGPU support. Use Chrome 113+, Edge 113+, or Safari 18+. Check support at webgpureport.org
  • Enable WebGPU in Chrome: Go to chrome://flags/#enable-unsafe-webgpu and enable it, then restart Chrome
  • Shader compilation errors: Usually indicates GPU compatibility issues. Try updating GPU drivers, using a different browser, or selecting a smaller model
  • GPU requirements: A compatible GPU (dedicated or integrated) is required. Some older or integrated GPUs may not support all WebGPU features
  • Update GPU drivers: Outdated drivers can cause shader errors. Update to the latest drivers from your GPU manufacturer
  • Try smaller models: If you encounter errors, try the smallest models first (Qwen2.5-0.5B or Qwen2-0.5B)
  • If you see "Failed to load WebLLM": Check the browser console (F12) for detailed errors
  • CORS errors: Make sure you're accessing via http://localhost:8000 or https:// (not file://)
  • Network errors: Ensure you have internet connection for initial library download
  • Model download errors: Check your browser's storage quota and internet connection
Explanation will appear here...

FAQ

How does the regex generator work?

The regex generator uses WebLLM, a browser-based AI model, to generate regular expressions from natural language descriptions. The model runs entirely in your browser.

Do I need to download a model?

Yes, the AI model needs to be downloaded and cached in your browser. This happens automatically on first use, or you can download it manually using the "Download & Cache Model" button. Some models are large and may require increasing your browser's cache size.

Which model should I use?

For most use cases, Phi-3 Mini 4K is recommended as it provides a good balance between size and performance. TinyLlama is the smallest but may be less accurate. Larger models like Llama 3 8B provide better accuracy but require more storage space.

Can I use this offline?

Once the model is downloaded and cached, you can use the generator offline. The model runs entirely in your browser without requiring an internet connection after the initial download.

Is my data sent to a server?

No. All processing happens entirely in your browser.