Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 760 Bytes

File metadata and controls

51 lines (33 loc) · 760 Bytes

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: