Skip to content

kometolabs/ai-api-examples

Repository files navigation

AI API Examples

  • simple JSON request/response
  • text streaming
  • Server-Side Events

A companion project for the blog post https://komelin.com/blog/build-ai-powered-api

Installation

Local model

ollama run gemma3n:e2b

Project dependencies

pnpm i

Run the server

pnpm start
# or node index.js

Test API

Yaak

Import Yaak config and play with the requests.

Manually

Send a POST request with the following JSON in the body:

{
  "question": "How are you?"
}

to one of the urls: