Skip to content

This is a FastAPI service that provides a RESTful API for the Anthropic Claude AI model using anthropic-sdk-python.

Notifications You must be signed in to change notification settings

furkankyildirim/anthropic-fastapi-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anthropic FastAPI Service

This is a FastAPI service that provides a RESTful API for the Anthropic Claude AI model using anthropic-sdk-python. For more information on the model, please refer to the Anthropic Claude AI model

Documentation

The API documentation can be found at http://localhost:8000/docs

Running the Project

Running the Project Locally

  1. Clone the repository
git clone https://github.com/furkankyildirim/anthropic-fastapi-service.git
cd anthropic-fastapi-service/
  1. Create a .env file in the root directory and add the following environment variables
ANTHROPIC_API_KEY=YOUR_API_KEY
  1. Create a system message file on src/data/system-messages.txt (Optional)
echo "You are a personal AI assistant" > src/data/system-messages.txt
  1. Create a virtual environment and install the dependencies
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Run the following commands to start the server
chmod +x runner.sh
./runner.sh

Running the Project with Docker

  1. Clone the repository
git clone https://github.com/furkankyildirim/anthropic-fastapi-service.git 
cd anthropic-fastapi-service/
  1. Create a .env file in the root directory and add the following environment variables
ANTHROPIC_API_KEY=YOUR_API_KEY
  1. Create a system message file on src/data/system-messages.txt (Optional)
echo "You are a personal AI assistant" > src/data/system-messages.txt
  1. Build and run the docker container
docker-compose up --build

About

This is a FastAPI service that provides a RESTful API for the Anthropic Claude AI model using anthropic-sdk-python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published