Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Language-client quickstarts

All four language clients speak the proxy's compact HTTP contract. The key difference is whether the package starts that proxy for you.

Availability: Python/TypeScript: bundled proxy, auto-start by default · Go/Ruby: pure HTTP, running proxy required

ClientInstallDefault process behavior
Pythonpip install llmshimStarts the bundled proxy on the first call
TypeScriptnpm install llmshimStarts the bundled proxy on the first call
Gogo get github.com/sanjay920/llmshim/clients/goConnects to http://localhost:3000
Rubygem install llmshimConnects to http://localhost:3000

The auto-started Python and TypeScript proxies are reused within the current process and stopped when it exits. TypeScript can instead connect to a proxy you already run by setting baseUrl; the current Python public API always uses its managed local proxy. Go and Ruby never spawn the Rust binary; start llmshim proxy before using their default clients.

Provider keys belong to the proxy process, not to the HTTP client. Configure them through environment variables or llmshim configure.

Python

pip install llmshim
import llmshim

response = llmshim.chat("gpt-5.6-sol", "What is Rust?")
print(response["message"]["content"])

The first call starts the bundled proxy automatically.

Python README · PyPI package

TypeScript / JavaScript

npm install llmshim
import { Client } from "llmshim";

const client = new Client();
const response = await client.chat({
  model: "openai/gpt-5.6-sol",
  messages: [{ role: "user", content: "What is Rust?" }],
});

console.log(response.message.content);

Constructing the client is synchronous. Its first request starts the bundled proxy. Pass baseUrl to new Client(...) to use an existing server instead.

TypeScript README · npm package

Go

go get github.com/sanjay920/llmshim/clients/go
package main

import (
	"context"
	"fmt"
	"log"

	llmshim "github.com/sanjay920/llmshim/clients/go"
)

func main() {
	client := llmshim.New()
	response, err := client.Chat(context.Background(), llmshim.ChatRequest{
		Model: "openai/gpt-5.6-sol",
		Messages: []llmshim.Message{
			{Role: "user", Content: "What is Rust?"},
		},
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(response.Message.Content)
}

llmshim.New() targets http://localhost:3000; it does not start the proxy.

Go README · Go module

Ruby

gem install llmshim
require "llmshim"

response = Llmshim.chat(
  model: "openai/gpt-5.6-sol",
  messages: "What is Rust?"
)

puts response.message.content

The module-level client targets LLMSHIM_BASE_URL when set, otherwise http://localhost:3000. It does not start the proxy.

Ruby README · RubyGems package

These snippets cover one non-streaming request. Use the linked client README as the canonical reference for streaming, errors, configuration, and native types rather than relying on duplicated method lists here.