JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q26465F
  • License Apache-2.0

Client for the NanoGPT API

Package Exports

  • nanogpt-client
  • nanogpt-client/dist/index

Readme

NanoGPT Client

An unofficial implementation of the NanoGPT API. This library aims to provide a Typescript client for both browser and node environments. It's built on the inferred OpenAPI spec.

Note: The API might change at any time which can render this client unusable, use at your own risk.

Install

npm install nanogpt-client

How to use

import { NanoGPTClient } from 'nanogpt-client'

const client = new NanoGPTClient(NANOGPT_API_KEY)

const { data, error } = await client.chat({
  body: {
    model: 'chatgpt-4o-latest',
    messages: [
      { role: 'system', content: 'initial system prompt' },
      { role: 'user', content: 'input from user' }
    ]
  }
})

Contributing

Please consult CONTRIBUTING for guidelines on contributing to this project.