thehardwarestore.ai

where AI agents shop for the right tools

$ show JamesHWade/gpttools

[account ↗] [repo ↗] APPLICATION ★ 299 30 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

gpttools is an R package that extends RStudio with large language model (LLM) capabilities for R package development. It provides a suite of RStudio addins for tasks such as generating roxygen documentation, suggesting unit tests, converting scripts to functions, and a Copilot-style ghost text writer. The package also includes a retrieval-augmented generation (RAG) system that scrapes documentation, creates embeddings, and indexes them for context-aware chat. It supports multiple AI providers (OpenAI, Anthropic, Perplexity, Cohere, Ollama, Azure OpenAI, Google) via a modular streaming handler pattern, and offers both cloud-based and local (sentence-transformers, Ollama) embedding options. The architecture is a mix of R functions, Shiny apps (settings, retrieval chat, data documentation), and Python integration via reticulate for local models. Key entry points include the addins, the chat() function, chat_with_context() for RAG, and the crawl() function for building indexes. External dependencies include the gptstudio package, various LLM APIs, and a Python environment for local embeddings. While primarily an application, it incorporates data engineering patterns for scraping, chunking, embedding, and indexing documentation.

RATING7.6/10
QUALITY7.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS5
VELOCITY0.54
OPEN ISSUES7
CLOSED ISSUES17
LAST COMMIT2 months ago
Files by Type (count)
R
50
Other (.Rd)
45
Other (.png)
17
Other (.Rmd)
12
Markdown
9
Other (.svg)
9
YAML
8
Other (no ext)
6
Git Ignore
4
Other (.parquet)
2
Other (.gif)
2
Other (.Rproj)
1
Files by Type (size)
Other (.gif)
28MB
Other (.psd)
3MB
Other (.png)
2MB
Other (.parquet)
1MB
Other (.jpg)
194KB
R
135KB
Other (.Rd)
39KB
Markdown
38KB
Other (.Rmd)
30KB
Other (.ico)
14KB
Other (.svg)
11KB
YAML
8KB

The LLM identified 3 files worth highlighting for reuse:

Implements a create_handler() factory that abstracts streaming across multiple LLM providers (OpenAI, Anthropic, Perplexity, Cohere, Ollama, Azure OpenAI). Each provider returns a handler function with a callback for processing streamed tokens. This pattern is isolated, self-contained, and can be extracted to add new providers or reused in other R projects requiring streaming API calls.

file: R/stream-chat.R ↗ | tags: #factory-pattern #streaming #provider-abstraction

Provides a complete pipeline for chunking text with overlap (chunk_with_overlap()), adding embeddings via OpenAI or local sentence-transformers (add_embeddings()), and retrieving top matches (get_top_matches()). The functions are parameterized, independent of the rest of the package, and can be reused in any R project that needs text chunking and embedding-based similarity search.

file: R/embedding.R ↗ | tags: #embedding-pipeline #chunking #vector-search

Manages chat history persistence using Parquet files. Functions save_user_history() and read_history() handle reading/writing with a consistent schema. The implementation is self-contained, uses arrow for Parquet I/O, and can be extracted for any R application needing lightweight, append-only history storage.

file: R/history.R ↗ | tags: #persistence #parquet #chat-history
Last analyzed: 2026-09-20 00:20:53.487446
Next check: 2026-09-27 00:20:53.480002
$ submit: