These examples use the direct API host,
https://api.nano-gpt.com. It has no IPv6 address, so clients with only IPv6 should use https://nano-gpt.com with the same paths. See API Hosts.Using goose with NanoGPT
goose connects to OpenAI-compatible services through a custom provider file. Save the file below and goose lists NanoGPT like any other provider.Setup
- Get your API key from nano-gpt.com/api.
-
Save this file as
nanogpt.jsonin goose’scustom_providersdirectory:- macOS and Linux:
~/.config/goose/custom_providers/ - Windows:
%APPDATA%\Block\goose\config\custom_providers\
- macOS and Linux:
-
Set your key and start goose with the NanoGPT provider:
To run a single prompt instead of a session:
Adding models
Add any NanoGPT text model to themodels list. goose needs tool calling, so pick models whose capabilities.tool_calling is true. GET /api/v1/models?detailed=true returns that flag and each model’s context_length; set context_limit to that value or lower.
This file was checked with goose 1.61.1. goose sends its requests, including its tool definitions, to /api/v1/chat/completions with your key as a Bearer token.