#Invalid adapter config... LangGraph (FastAPI), CopilotKit (no NextJS), CopilotRuntime (Node.js HTTP)

1 messages · Page 1 of 1 (latest)

vestal fulcrum
#

Attempting to wire up the lightest weight combo I can think of, but I'm stuck at "Invalid adapter configuration: EmptyAdapter is only meant to be used with agent lock mode. For non-agent components like useCopilotChatSuggestions, CopilotTextarea, or CopilotTask, please use an LLM adapter instead.
NOTE: This error only displays during local development."

CopilotKit: Vite React app (without Next.js)
CopilotRuntime: Node.js HTTP
CoAgent: LangGraph Self hosted (FastAPI)

import { createServer } from 'node:http';
import {
  CopilotRuntime,
  ExperimentalEmptyAdapter,
  copilotRuntimeNodeHttpEndpoint,
} from '@copilotkit/runtime';


const serviceAdapter = new ExperimentalEmptyAdapter();

const server = createServer((req, res) => {
  const runtime = new CopilotRuntime({
    remoteEndpoints: [
      { url: "http://localhost:8000/langgraph" },
    ],
  });

  const handler = copilotRuntimeNodeHttpEndpoint({
    endpoint: '/copilotkit',
    runtime,
    serviceAdapter,
  });

  return handler(req, res);
});

server.listen(4000, () => {
  console.log('Listening at http://localhost:4000/copilotkit');
});
boreal agate
#

Hey @vestal fulcrum , Only use ExperimentalEmptyAdapter if you are in agent lock mode and don’t need chat suggestions or textarea features. As per the code and error message you shared, you need to replace ExperimentalEmptyAdapter with a real LLM adapter (like OpenAIAdapter) for non-agent CopilotKit features to work:

  1. Install the OpenAI SDK: npm install openai
  2. Replace your adapter code with:
    import { OpenAIAdapter } from '@copilotkit/runtime';
    import OpenAI from 'openai';
    const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
    const serviceAdapter = new OpenAIAdapter({ openai });
vestal fulcrum
#

Thanks, this issue was resolved ! 🙂

#

Closing