https://github.com/statico/llm-tools-brave
A tool plugin for LLM to support web search via Brave
https://github.com/statico/llm-tools-brave
Last synced: 11 months ago
JSON representation
A tool plugin for LLM to support web search via Brave
- Host: GitHub
- URL: https://github.com/statico/llm-tools-brave
- Owner: statico
- License: mit
- Created: 2025-05-31T00:33:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-21T16:13:39.000Z (about 1 year ago)
- Last Synced: 2025-06-21T16:35:47.481Z (about 1 year ago)
- Language: Python
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# llm-tools-brave
A tool plugin for [LLM](https://llm.datasette.io/) that allows you to search the web using [Brave Search API](https://brave.com/search/api/).
[](https://pypi.org/project/llm-tools-brave/)
[](https://github.com/statico/llm-tools-brave/actions/workflows/test.yml)
[](https://github.com/statico/llm-tools-brave/blob/main/LICENSE)
## Installation
Install this plugin in the same environment as [LLM](https://llm.datasette.io/):
```bash
llm install llm-tools-brave
```
## Usage
Create an account at [Brave Search API](https://api-dashboard.search.brave.com/) and get your API key. Add it to llm with `llm keys set brave`.
This plugin provides four search tools which can be bundled together or provided separately.
Use `-T Brave` to include all tools, or use individual tool names: `-T web_search`, `-T image_search`, `-T news_search`, `-T video_search`.
### web_search
Search the web for high-quality, relevant results with descriptions and snippets:
```bash
llm -m claude-4-sonnet -T web_search "search the web to get today's weather in nyc"
```
### image_search
Search for images with metadata and thumbnails:
```bash
llm -m claude-4-sonnet -T image_search "find images of golden retrievers"
```
### news_search
Search for recent news articles with age and source information:
```bash
llm -m claude-4-sonnet -T news_search "latest news about AI developments"
```
### video_search
Search for videos with duration, thumbnails, and source information:
```bash
llm -m claude-4-sonnet -T video_search "python programming tutorials"
```
## Features
- **Web Search**: Get comprehensive web results with descriptions and extra snippets
- **Image Search**: Find images with metadata, dimensions, and thumbnail previews
- **News Search**: Access recent news articles with publication timing
- **Video Search**: Discover videos with duration and preview information
- **Advanced Filtering**: Support for country-specific results, language preferences, freshness filters, and domain inclusion/exclusion
- **Error Handling**: Robust error handling with informative error messages
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd llm-tools-brave
python -m venv venv
source venv/bin/activate
```
Install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
pytest
```
## Dependencies
- [llm](https://llm.datasette.io/): The LLM CLI tool this plugin extends
- [httpx](https://www.python-httpx.org/): For making HTTP requests to the Brave Search API
## Credits
> [!NOTE]
> This is a fork of [llm-tools-exa](https://github.com/daturkel/llm-tools-exa) by [Dan Turkel](https://github.com/daturkel), converted from the Exa API to Brave Search API. All credit for the original implementation goes to Dan Turkel. This conversion was mostly vibe coded with Claude 4 and Cursor.