Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ameshkov/llm-ads-demo
Demo project that shows how LLM ads are implemented
https://github.com/ameshkov/llm-ads-demo
adguard ads chatgpt llm
Last synced: 24 days ago
JSON representation
Demo project that shows how LLM ads are implemented
- Host: GitHub
- URL: https://github.com/ameshkov/llm-ads-demo
- Owner: ameshkov
- Created: 2024-10-07T16:20:56.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-17T14:51:22.000Z (3 months ago)
- Last Synced: 2024-10-24T12:43:53.922Z (2 months ago)
- Topics: adguard, ads, chatgpt, llm
- Language: JavaScript
- Homepage:
- Size: 380 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLM ads demo
This is a demo project that demonstrates how LLM ads can be implemented and
also how they can be blocked.You can check out the demo here [llm-afds-demo.pages.dev](https://llm-afds-demo.pages.dev/).
## How to run locally
```bash
npm install
npm run dev
```For local development it is recommended to keep `ENV` to `local` in
`vite.config.js` to avoid expensive calls to OpenAI API.If you need to test the OpenAI API, you can set `ENV` to `prod` and
provide your OpenAI token in `.env` file.```properties
API_TOKEN=sk-proj-...
```## How to deploy
The demo project is supposed to be deployed on Cloudflare Pages. Check out
the Github Actions workflow in `.github/workflows/deploy.yml` for more details.If you want to deploy the project on your own, you'll need to do the following:
* Add a secret to the Cloudflare Pages project with your OpenAI token: `API_TOKEN`.
* Add Workers AI binding to `AI` in the project settings.
* Set up **strict** budget and rate limiting rules in OpenAI since the page
functions are not protected.