Instructions to use Zwounds/boolean-search-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zwounds/boolean-search-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Zwounds/boolean-search-model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Zwounds/boolean-search-model") model = AutoModelForCausalLM.from_pretrained("Zwounds/boolean-search-model") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use Zwounds/boolean-search-model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Zwounds/boolean-search-model", filename="boolean.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Zwounds/boolean-search-model with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Zwounds/boolean-search-model # Run inference directly in the terminal: llama-cli -hf Zwounds/boolean-search-model
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Zwounds/boolean-search-model # Run inference directly in the terminal: llama-cli -hf Zwounds/boolean-search-model
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Zwounds/boolean-search-model # Run inference directly in the terminal: ./llama-cli -hf Zwounds/boolean-search-model
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Zwounds/boolean-search-model # Run inference directly in the terminal: ./build/bin/llama-cli -hf Zwounds/boolean-search-model
Use Docker
docker model run hf.co/Zwounds/boolean-search-model
- LM Studio
- Jan
- vLLM
How to use Zwounds/boolean-search-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zwounds/boolean-search-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zwounds/boolean-search-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Zwounds/boolean-search-model
- SGLang
How to use Zwounds/boolean-search-model with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Zwounds/boolean-search-model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zwounds/boolean-search-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Zwounds/boolean-search-model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zwounds/boolean-search-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Zwounds/boolean-search-model with Ollama:
ollama run hf.co/Zwounds/boolean-search-model
- Unsloth Studio new
How to use Zwounds/boolean-search-model with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Zwounds/boolean-search-model to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Zwounds/boolean-search-model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Zwounds/boolean-search-model to start chatting
- Pi new
How to use Zwounds/boolean-search-model with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Zwounds/boolean-search-model
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Zwounds/boolean-search-model" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Zwounds/boolean-search-model with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Zwounds/boolean-search-model
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Zwounds/boolean-search-model
Run Hermes
hermes
- Docker Model Runner
How to use Zwounds/boolean-search-model with Docker Model Runner:
docker model run hf.co/Zwounds/boolean-search-model
- Lemonade
How to use Zwounds/boolean-search-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Zwounds/boolean-search-model
Run and chat with the model
lemonade run user.boolean-search-model-{{QUANT_TAG}}List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
Boolean Search Query Model
Convert natural language queries into proper boolean search expressions for academic databases. This model helps researchers and librarians create properly formatted boolean search queries from natural language descriptions.
Features
- Converts natural language to boolean search expressions
- (MOSTLY!) Handles multi-word terms correctly with quotes
- Removes meta-terms (articles, papers, research, etc.)
- Groups OR clauses appropriately
- Minimal, clean formatting
Installation
pip install transformers torch unsloth
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"Zwounds/boolean-search-model",
max_seq_length=2048,
dtype=None, # Auto-detect
load_in_4bit=True
)
FastLanguageModel.for_inference(model)
Quick Start
# Format your query
query = "Find papers about climate change and renewable energy"
prompt = f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert this natural language query into a boolean search query by following these rules:
1. FIRST: Remove all meta-terms from this list (they should NEVER appear in output):
- articles, papers, research, studies
- examining, investigating, analyzing
- findings, documents, literature
- publications, journals, reviews
Example: "Research examining X" β just "X"
2. SECOND: Remove generic implied terms that don't add search value:
- Remove words like "practices," "techniques," "methods," "approaches," "strategies"
- Remove words like "impacts," "effects," "influences," "role," "applications"
- For example: "sustainable agriculture practices" β "sustainable agriculture"
- For example: "teaching methodologies" β "teaching"
- For example: "leadership styles" β "leadership"
3. THEN: Format the remaining terms:
CRITICAL QUOTING RULES:
- Multi-word phrases MUST ALWAYS be in quotes - NO EXCEPTIONS
- Examples of correct quoting:
- Wrong: machine learning AND deep learning
- Right: "machine learning" AND "deep learning"
- Wrong: natural language processing
- Right: "natural language processing"
- Single words must NEVER have quotes (e.g., science, research, learning)
- Use AND to connect required concepts
- Use OR with parentheses for alternatives (e.g., ("soil health" OR biodiversity))
Example conversions showing proper quoting:
"Research on machine learning for natural language processing"
β "machine learning" AND "natural language processing"
"Studies examining anxiety depression stress in workplace"
β (anxiety OR depression OR stress) AND workplace
"Articles about deep learning impact on computer vision"
β "deep learning" AND "computer vision"
"Research on sustainable agriculture practices and their impact on soil health or biodiversity"
β "sustainable agriculture" AND ("soil health" OR biodiversity)
"Articles about effective teaching methods for second language acquisition"
β teaching AND "second language acquisition"
### Input:
{query}
### Response:
"""
# Generate boolean query
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result) # "climate change" AND "renewable energy"
Examples
Input queries and their boolean translations:
Natural: "Studies about anxiety depression stress in workplace"
- Boolean: (anxiety OR depression OR stress) AND workplace
Natural: "Articles about artificial intelligence ethics and regulation or policy"
- Boolean: "artificial intelligence" AND (ethics OR regulation OR policy)
Natural: "Research on quantum computing applications in cryptography or optimization"
- Boolean: "quantum computing" AND (cryptography OR optimization)
Rules
The model follows these formatting rules:
Meta-terms are removed:
- "articles", "papers", "research", "studies"
- Focus on actual search concepts
Quotes only for multi-word terms:
- "artificial intelligence" AND ethics β
- NOT: "ethics" AND "ai" β
Logical grouping:
- Use parentheses for OR groups
- (x OR y) AND z
Minimal formatting:
- No unnecessary parentheses
- No repeated terms
Local Development
# Clone repo
git clone https://github.com/your-username/boolean-search-model.git
cd boolean-search-model
# Install dependencies
pip install -r requirements.txt
# Run tests
python test_boolean_model.py
Contributing
- Fork the repository
- Create your feature branch
- Add tests for any new functionality
- Submit a pull request
Model Card
See MODEL_CARD.md for detailed model information including:
- Training data details
- Performance metrics
- Limitations
- Intended use cases
License
This model is subject to the Llama 2 license. See the LICENSE file for details.
Citation
If you use this model in your research, please cite:
@misc{boolean-search-llm,
title={Boolean Search Query LLM},
author={Stephen Zweibel},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/Zwounds/boolean-search-model}
}
Contact
Stephen Zweibel - @szweibel
- Downloads last month
- 33
We're not able to determine the quantization variants.
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Zwounds/boolean-search-model", filename="boolean.gguf", )