setup-environment
Set up the embedding model for semantic search. model2vec-rs downloads models automatically; use when build fails or model download issues occur.
When & Why to Use This Skill
This Claude skill automates the environment setup for semantic search by configuring the model2vec-rs embedding model. It streamlines the deployment of the Potion-base-32M model, ensuring high-performance vector embeddings are ready for use while providing fallback mechanisms for build failures and network-related download issues.
Use Cases
- Scenario 1: Initializing a local semantic search engine by automatically downloading and caching the required 130MB embedding model.
- Scenario 2: Troubleshooting and resolving 'Failed to load model' errors during the build process of search-intensive applications.
- Scenario 3: Configuring hybrid search environments where users can toggle between full semantic indexing and fast FTS5 text-only search to save resources.
| name | setup-environment |
|---|---|
| description | Set up the embedding model for semantic search. model2vec-rs downloads models automatically; use when build fails or model download issues occur. |
Environment Setup for Semantic Search
Instructions
glhf uses model2vec-rs with Potion-base-32M for embeddings. The model downloads automatically on first use.
Quick Setup
No manual setup required:
cargo build --release
./target/release/glhf index
The embedding model (~130MB) will download to the HuggingFace cache on first run.
Model Details
| Property | Value |
|---|---|
| Model | minishlab/potion-base-32M |
| Dimensions | 512 |
| Size | ~130MB |
| Cache Location | ~/.cache/huggingface/ |
Verify Setup
# Run embedding tests
cargo test embed -- --ignored
Common Issues
| Error | Solution |
|---|---|
Failed to load model |
Check internet connection, model will auto-download |
No space left |
Clear HuggingFace cache: rm -rf ~/.cache/huggingface/ |
Slow first run |
Normal - model downloads once, then cached |
Skip Embeddings
For text-only search (faster indexing, no model download):
glhf index --skip-embeddings
This enables FTS5 search but disables semantic/hybrid modes.