Skip to contents

poppychat provides an R code interface to chat with large language models through Poppy, a service provided by the California Department of Technology in a pilot to a group of State of California employees. Poppy models are sandboxed for State use. poppychat is intended to facilitate the secure integration of Poppy’s capabilities into R code, dashboards, and other applications.

State of California employee use of Poppy should adhere to the latest GenAI State Policies.

Installation

You can install the development version of poppychat from GitHub with:

devtools::install_github("lucy-dwr/poppychat")

Usage

poppy_chat(), the main function in this package, creates a chat client configured to connect to Poppy using a user-supplied API key. poppy_chat()is a thin wrapper for ellmer::chat_openai_compatible(). To get started, set the POPPY_API_KEY environment variable. See vignette("poppychat") for details.

gemini_chat <- poppychat::poppy_chat(model = "Google Gemini 2.5 Flash")

gemini_chat$chat("What's the best thing about working for the State of California? Be brief!")
#> Many employees value the opportunity to serve the public and make a
#> a meaningful difference for Californians, alongside comprehensive benefits
#> and job stability.

ellmer chat clients support a variety of features, including:

  • Conversation history
  • Token tracking
  • System prompts
  • Tool calling
  • Structured data extraction
  • Retrieval-augmented generation

For more information on using a chat client, review package documentation from ellmer.

Currently supported models

Poppy offers access to the following models:

  • Anthropic Claude Haiku 4.5
  • Anthropic Claude Sonnet 4.5
  • AWS Nova Micro
  • AWS Nova Pro
  • Azure gpt-4.1
  • Azure gpt-4.1-mini
  • Azure gpt-5-mini
  • Azure gpt-5.1
  • Google Gemini 2.5 Flash
  • Google Gemini 2.5 Flash-Lite