Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 805 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 805 Bytes

TypeScript Parser Project

A TypeScript-based parser implementation that uses Zod for schema validation with retries to force an LLM to return a structured output. Uses Ollama as the LLM provider with llama3.2. This is a companion project to the Adding structured outputs as a feature to any LLM blog post.

Prerequisites

  • Node.js and npm installed
  • Ollama running locally with the llama3.2 model

Setup

  1. Install dependencies:
npm install

Usage

tsx index.ts

This should return a JSON object with a movie recommendation.

{
  "title": "The Shawshank Redemption",
  "year": 1994,
  "rating": 9,
  "genres": ["Drama", "Thriller"]
}

License

This project is licensed under the MIT License.