Skip to content

Instantly share code, notes, and snippets.

View josephwecker's full-sized avatar

Joseph Wecker josephwecker

View GitHub Profile
@arungpisyadi
arungpisyadi / main.py
Last active July 29, 2025 21:23
How to use Perplexity AI API as the LLM Model for CrewAI in FastAPI framework.
import os
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from fastapi.requests import Request
from fastapi.encoders import jsonable_encoder
from typing import List
from pydantic import BaseModel
from crewai import Agent, Task, Crew, Process
from langchain_community.chat_models import ChatPerplexity