Skip to content

LLM-Studios/ctx-store

Repository files navigation

Context Store API

A lightweight service for managing threads and messages for AI SDK driven LLM applications.

Quick Start

  1. Start the server
npx ctx-store
  1. Initialize the client
import { createClient } from "@ctx-store/client";

const ctxStore = createClient();
  1. Create a thread and add a message
const thread = await ctxStore.createThread();

await ctxStore.createMessages(thread.id, [
	{
		role: "user",
		content: "Hello, world!",
	},
]);
  1. Use together with AI SDK
const { text } = await generateText({
	model: "gpt-4o",
	messages: [{ role: "user", content: "Hello, world!" }],
	onFinish: async ({ response }) => {
		await ctxStore.createMessages(thread.id, response.messages);
	},
});

https://llmstudios.de/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages