Thinwrap now speaks Go — and wraps LLMs

· 2 min read

#announcement #llm #go

Since the v1.0 launch Thinwrap has been two scopes in two languages. Today it’s three scopes in three languages — with Python next.

Two things shipped:

  • Go, everywhere. All three scopes now have a Go module: location-go, notifications-go, and llm-go. Same facade shape, same normalized results, same provider ids as the TypeScript and PHP siblings.
  • A new LLM scope. @thinwrap/llm · thinwrap/llm · llm-go — one typed Chat facade over 18 providers, plus embeddings on the 11 that support them.

The LLM scope

One facade, every vendor. Fifteen providers speak the OpenAI-compatible dialect and share a single connector; Anthropic, Bedrock, and Gemini get native adapters that normalize onto the exact same ChatResult. Switching vendor is the provider id plus the model — nothing else changes:

import { Chat } from '@thinwrap/llm';

const chat = new Chat('openai', { apiKey: process.env.OPENAI_API_KEY! });
const res = await chat.complete({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'Say hi in one word.' }],
});

// same call, different vendor:
const claude = new Chat('anthropic', { apiKey: process.env.ANTHROPIC_API_KEY! });

Streaming, embeddings (on the OpenAI-float subset), and per-provider quirks are all there. What’s deliberately not there: routing, retries, budgets, caching, or an egress hop. Thinwrap LLM is the in-process, zero-egress complement to a gateway — it makes your call sites vendor-neutral and leaves the operational layer wherever you already run it. Provider-specific request fields ride through _passthrough; the raw vendor body is always on result.raw.

Go, with the discipline intact

The Go modules hold the line the whole project is built on: truly zero dependencies — the standard-library net/http is the only HTTP surface, and the signing bits (Bedrock SigV4, FCM/APNs JWTs) are hand-rolled on crypto/*. Bring your own *http.Client, errors are values, and the wrapper holds no state.

chat, _ := llm.NewChat(llm.OpenAI, llm.OpenAICompatConfig{APIKey: os.Getenv("OPENAI_API_KEY")})
res, err := chat.Complete(ctx, llm.ChatInput{
    Model:    "gpt-4o-mini",
    Messages: []llm.ChatMessage{{Role: "user", Content: "Say hi in one word."}},
})

Also in this release

@thinwrap/location and @thinwrap/notifications (and their PHP siblings) moved to 1.1.0. The Go and LLM packages start at 1.0.0. Python is the next language on the list.

Get started

npm install @thinwrap/llm            # or @thinwrap/location, @thinwrap/notifications
composer require thinwrap/llm        # PHP
go get github.com/thinwrap/llm-go    # Go

Browse everything in the catalog, or read the per-language honesty pages: /typescript, /php, /go. Feedback and PRs welcome on GitHub.