BayLeaf AI Playground
An experimental Generative AI Playground for UC Santa Cruz
About the AI Playground
BayLeaf Chat and BayLeaf API form an experimental Generative AI Playground designed to serve the entire UC Santa Cruz campus community (students, faculty, and staff). The system is operated by Adam Smith (faculty from the Department of Computational Media), as a living prototype of a possible future university-managed service.
Responsible Design
BayLeaf is designed as a form of harm reduction with respect to widely acknowledged problems with commercial AI offerings: runaway energy consumption, extractive data practices, closed ecosystems that concentrate power outside of universities, and tools that prioritize engagement over learning and rigor.
- Energy: Smaller models, smaller footprints. AI's growing energy and resource footprint is a legitimate concern. The flagship models from mainstream providers can have trillions of parameters, and training compute, energy, and cost all scale with parameter count. BayLeaf exclusively uses mid-sized models (tens to hundreds of billions of parameters), consuming proportionally less energy and other resources.
- Reciprocity: Built on open-weight models. Large-scale AI is often criticized for concentrating power in a few corporations behind closed APIs. BayLeaf exclusively uses open-weight models: models that are contributed back to the public web, available for anyone to download, audit, or build on. This is a form of structural reciprocity with the open ecosystem that makes this technology possible.
- Privacy: Your data is never stored outside of BayLeaf. Many commercial AI services retain copies of user conversations, sometimes for 30 days or longer, creating exposure that users cannot control. BayLeaf leverages zero-data-retention (ZDR) inference services so that no LLM provider stores a copy of your data. Within BayLeaf itself, the chat interface maintains one copy of your messages in an encrypted database accessible only by the system administrator.
- Pedagogy: Support and resistance, not just answers. Commercial AI assistants are optimized to be maximally helpful, which in practice means maximally doing-it-for-you: students mistake speed for understanding, and the skills education is supposed to build quietly atrophy. BayLeaf's models use system prompts and agent skills written by educators for their students and peers, designed to scaffold learning rather than shortcut it. Faculty control means the tool can be co-designed with students, not imposed by a product team.
- Inquiry: Grounded in sources of truth. General-purpose chatbots reward fluent output over rigorous inquiry: they generate plausible answers without grounding them in the user's actual data, documents, or methods, producing false confidence where skepticism is needed. BayLeaf connects models to grounded tools (web search, Google Workspace, code execution) so that AI-assisted inquiry can be anchored in evidence the user can verify. The system itself is counterfoil research: a working experiment in AI infrastructure that doesn't teach dependence on commercial platforms.
Subprocessors: services that handle data on behalf of BayLeaf
- OpenRouter: LLM request routing (ZDR providers only; see provider data retention details)
- DigitalOcean: hosts BayLeaf Chat (application and encrypted database)
- Cloudflare: hosts BayLeaf API (Worker and edge database)
- Daytona: sandboxed code execution environments
- Tavily: web search API (no conversation data stored)
- Jina Reader: web page content extraction
- CILogon: user authentication (via CruzID Google Account OIDC)
Chat Service
Our Chat service provides three models to all users:
- Basic is a general-purpose assistant (which underlying model varies as better ones become available). Its system prompt is written for the campus community, orienting the model as a concise assistant with self-knowledge of BayLeaf and the Chat interface.
- Deep Research pairs the same model with web search and web page retrieval toolkits, enabling interactive research sessions. It states its intent before each web lookup and summarizes what it finds, so users can follow the research path for themselves.
- Help is a help desk for BayLeaf itself. It can answer questions about the service, list a user's groups and available models, inspect model configurations, and grant access to specialized groups. Users who receive invite codes from instructors or program coordinators redeem them here.
Beyond the public models, specialized models and toolkits are available to members of specific access groups (e.g. course sections, departments, or programs).
The Code Sandbox toolkit gives models access to a persistent, sandboxed Linux environment, making it possible to run command-line tools directly from the browser. This enables tasks like file processing, scripting, and interacting with external services through CLI tools without leaving the chat interface.
Most chat models are subject to a rate limit mechanism that ensures fair and cost-efficient access for all.
Tip: Chat message replies from models are limited in length based on the number of turns in the conversation so far. Users should prefer many short conversations on distinct topics rather than one long one that meanders through unrelated topics.
API Service
Our API service provides key-less access to users connecting from the campus network (e.g. 169.233.x.x), and it allows authenticated users to grant themselves an API key for off-campus access.
This API injects a short system prompt prefix to all proxied requests to lightly customize downstream agents for use with the Playground.
To allow for experimentation, API requests are not closely rate limited, but individual keys are subject to a reasonable total daily spending limit.
For a list of models and per-token prices, visit OpenRouter's model directory.
Code Sandbox
The API also provides sandboxed Linux environments (backed by
Daytona) for code execution and file
management. Keyed users get a persistent sandbox that retains files
across sessions, while campus-pass users get ephemeral sandboxes
that are created and destroyed per request. The same sk-bayleaf- API key
authenticates both LLM inference and sandbox access.
Web Search & Fetch
The API provides web search (backed by
Tavily) and page content extraction
(backed by Jina Reader) as first-class endpoints.
Agents can search the web for information and fetch clean, extracted content from any
URL, all authenticated with the same sk-bayleaf- API key used for LLM
inference and sandbox access.
Tool Integrations
The API dashboard distributes setup instructions and credentials for CLI tools that extend what coding agents can do on behalf of authenticated users:
- Google Workspace CLI (gws): Access Drive, Gmail, Calendar, Sheets, and Docs. BayLeaf distributes the OAuth client configuration so users don't need their own GCP project.
- Canvas LMS CLI (canvaslms): Manage courses, assignments, grades, and announcements. Users authenticate with their own Canvas access token.
In the News
- UCSC's Newly Established AI Council Is at a Crossroads (City on a Hill Press, March 2026.) Student journalism covering UCSC's AI Council and the campus debate over vendor deals vs. faculty-built tools. BayLeaf is cited as an example of the latter approach.
- Secure AI Tools Now Available to Staff (UCSC News, February 2026.) Official campus announcement of Google Gemini Chat and NotebookLM for staff, developed in consultation with the AI Council. BayLeaf predates and complements this rollout.
Related Projects
- Lathe: The open-source toolkit powering the Code Sandbox feature above. Reusable by any Open WebUI deployment. Includes support for tools like canvaslms (a Python/CLI Canvas LMS client) for agentic course management from the browser.
- GWS Toolkit: Deep integration with Google Workspace (Drive, Gmail, Calendar, Sheets, Docs) packaged as a reusable Open WebUI toolkit. Per-chat, per-service user consent. Built for BayLeaf Chat; drop-in for any Open WebUI deployment with Google Workspace.
Beyond UCSC
BayLeaf is open source, built in a municipalist spirit: it serves one campus, not the entire higher education sector. The architecture is not UCSC-specific, but it is intentionally local: designed to be copied and remixed to fit the needs of other campuses, not scaled into a platform that governs them.
If you're evaluating AI tools for your campus, read the case for universities owning their own AI infrastructure, or explore the source.
GenAI Disclosure
Nearly 100% of the code, documentation, and other project data in the BayLeaf repository was created using generative AI in agentic coding tools. This is an intentional choice: it demonstrates that sufficient capacity exists within the university to build and operate a service like this, without ceding control or responsibility to external parties. If you are a critic, ally, or other human who wants a direct human connection, please contact Adam Smith directly.