Skip to content

Instantly share code, notes, and snippets.

@lestan
lestan / route.ts
Created June 29, 2025 03:07
CopilotKit with Ollama and OpenAI API compatibility
import {
CopilotRuntime,
copilotRuntimeNextJSAppRouterEndpoint,
LangChainAdapter,
OpenAIAdapter,
langGraphPlatformEndpoint
} from "@copilotkit/runtime";
import { NextRequest } from "next/server";
import { ChatOpenAI } from "@langchain/openai";
@lestan
lestan / basic_autogen_agent_llm.py
Created March 13, 2024 03:19
AutoGen AI Agents with Local LLM served via Ollama
"""Author: https://github.com/lestan"""
"""Tested on AutoGen version 0.2.19"""
"""This is a basic working version of AutoGen that uses a local LLM served by Ollama"""
from autogen import AssistantAgent, UserProxyAgent, ConversableAgent
from autogen.coding import LocalCommandLineCodeExecutor, DockerCommandLineCodeExecutor
import os
from pathlib import Path
import pprint
#model = "mixtral:latest"