Skip to content

Get started quickly with an LLM project in TypeScript. With testing and CI/CD.

License

Notifications You must be signed in to change notification settings

briangershon/prompt-playground

Repository files navigation

prompt-playground

Get started quickly with an LLM project in TypeScript. With testing and CI/CD.

Example code generates a Haiku poem and then tests Haiku's validity with a different LLM model.

Features

  • use any LLM model that is supported by the Vercel AI SDK, such as from Anthropic.
  • automated testing with vitest (using a less expensive model)
  • GitHub action that runs tests on every push

Get started

Create a .env file with the following:

ANTHROPIC_API_KEY=

ANTHROPIC_API_KEY is the API key for the Anthropic API.

Run:

yarn
yarn dev

Also add ANTHROPIC_API_KEY to GitHub repository secrets so the GitHub actions can run.

Run tests

Run all tests:

yarn test

Run only the slow and expensive LLM tests:

yarn test-llm

Run only the fast unit tests (no LLM):

yarn test-unit

About

Get started quickly with an LLM project in TypeScript. With testing and CI/CD.

Topics

Resources

License

Stars

Watchers

Forks