BayLeaf

A situated counterplatform for Generative AI at UC Santa Cruz

BayLeaf Chat BayLeaf API
Blog Use Cases Source Support

About BayLeaf

BayLeaf Chat and BayLeaf API are the working services of a situated counterplatform for Generative AI, designed to serve the entire UC Santa Cruz campus community (students, faculty, and staff). BayLeaf is operated by Adam Smith (faculty from the Department of Computational Media) as a living prototype of a possible future university-managed service.

For concrete recipes (chasing down a half-heard funding lead, rescuing a misconfigured Canvas assignment, drafting a workflow doc from scattered emails), see the use cases page.

Anarchist AI Infrastructure: a 45-minute guest lecture series making the political case for campus-owned AI, given by Adam Smith for a UCSC course.

From the BayLeaf Blog

All posts
  1. Blocking Closed-Weight Models And other lines we could draw
  2. Military-grade Encryption *pew pew*
  3. Reduce, Reuse, Recycle reflections on a recent boo-boo
  4. Offramps and where they lead
  5. Tokens are Words, Not Money even if they seem to cost money

Counterplatform Design

BayLeaf is a counterplatform: one situated response to the terms on which Generative AI is offered to universities. Building and operating a platform makes another set of terms concrete and available for use, scrutiny, and revision. BayLeaf treats AI as normal technology: consequential, but neither autonomous nor inevitable. The commitments below govern how this alternative is designed and operated at UC Santa Cruz.

BayLeaf relies on a small set of subprocessors (OpenRouter, Tinfoil, DigitalOcean, Cloudflare, Daytona, Tavily, CILogon): see the privacy notice for the full list, what each one does, and the retention policies that govern your data.

Institutional Footing

A path toward institution-managed inference. UC has in-place data-protection agreements with Google Cloud and Amazon Web Services, but BayLeaf is faculty-operated from a personal administrator account and is not covered by those agreements. Its Vertex AI, AWS Bedrock, and NRP inference back-ends are disabled and carry no traffic. Active inference uses OpenRouter ZDR or Tinfoil Sealed. The full contract and retention analysis is public in our FERPA notes.
Security-reviewed by UCSC ITS. BayLeaf has undergone a security review by the UC Santa Cruz Information Technology Services (ITS) office. The campus Chief Information Security Officer (CISO) and his team reviewed the service and deemed it ready to launch: technically cleared to handle data up to Protection Level 3 (P3). That is a security determination about how BayLeaf protects data; it is distinct from legal authorization to process specific regulated records. In particular, clearance to use BayLeaf with actual FERPA student education records is a separate process, still underway with the Registrar, and is not yet granted. To be clear about scope, BayLeaf is not an ITS-operated or ITS-supported service; it remains faculty-operated. The review attests to its security posture, not to institutional adoption.

Chat Service

Our Chat service provides two models to all users:

Beyond the public models, specialized models and toolkits are available to members of specific access groups (e.g. course sections, departments, or programs).

Chat uses a curated OpenRouter ZDR selection that can include both proprietary and open-weight models.

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.

The API leaves system and developer instructions under the caller's control rather than adding BayLeaf-specific instructions to proxied requests.

To allow for experimentation, API requests are not closely rate limited, but individual keys are subject to a reasonable total daily spending limit.

The plaintext API uses OpenRouter but permits only verifiably open-weight models. OpenRouter must publish a nonempty hugging_face_id and the Hugging Face repository must resolve. Positive and definite-negative decisions are cached in MODEL_STATUS KV for 24 hours. An unknown result fails closed with HTTP 403 and is not cached. OpenRouter's public catalog is broader than BayLeaf's permitted set and includes models BayLeaf will reject.

API Sealed is an active confidential-inference lane through Tinfoil. It currently offers only open-weight models, and clients encrypt the requested model and body to an attested enclave before either reaches BayLeaf. Non-streaming usage metadata can report which model executed. There is no plaintext fallback.

Code Sandbox

The API also provides sandboxed Linux environments (backed by Daytona) for code execution and file management. Users get a persistent sandbox that retains files across sessions. Sandbox access requires a personal sk-bayleaf- API key, including on campus; the same key authenticates both LLM inference and sandbox access.

Web Search & Fetch

The API provides web search and page content extraction as first-class endpoints, both backed by Tavily. Agents can search the web for information and fetch clean, extracted content from one or many URLs in a single call, 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:

Adoption

BayLeaf is in active use across UCSC courses. A representative sample:

Course-specific agents (Brace, Brace2, Brace3, Gambit) are built atop BayLeaf Chat with custom system prompts and toolkits. Other courses use BayLeaf's general-purpose Basic model directly.

For more granular examples of what individual users (faculty, students, and staff) actually do with BayLeaf, see the use cases page.

Ad-hoc faculty use

Beyond enrolled courses, faculty across campus use BayLeaf for one-off course-management tasks: running scripts in the Chat Code Sandbox or driving agentic CLI tools through the BayLeaf API to manipulate Canvas. Reported uses include:

In the News

Spinoff Projects

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. This is the prefigurative counterpower move: build small, autonomous systems that embody the values you want to see, rather than waiting for centralised infrastructure to be reformed from within.

A 2026 Inside Higher Ed survey of campus CTOs found that half question whether their AI investments are paying off, while 41% cite "falling behind peer institutions" as a top worry through 2030. That combination, doubt about value paired with fear of missing out, is the imitation trap BayLeaf is built to refuse. A campus-owned service can be small, problem-led, and accountable to its own community rather than benchmarked against whatever neighboring institutions just bought.

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.