AbstikaAI / README.md
Balaji Gite
Updated code
f650505
|
Raw History Blame Contribute Delete
1.43 kB
metadata
title: AbstikaTestLLM
emoji: 🐨
colorFrom: blue
colorTo: pink
sdk: docker
pinned: false
license: mit

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

FastAPI Sample Project

This is a simple FastAPI application with sample GET and POST endpoints for testing.

Features

  • GET /: Returns a greeting message.
  • POST /items/: Accepts a JSON body with name and description fields and returns the item.

Requirements

Installation & Running Locally

  1. Install dependencies:
    pip install -r requirements.txt
    
  2. Start the server:
    uvicorn main:app --reload
    
  3. Open your browser at http://127.0.0.1:8000

API Examples

GET /

curl http://127.0.0.1:8000/

POST /items/

curl -X POST "http://127.0.0.1:8000/items/" -H "Content-Type: application/json" -d '{"name": "Sample Item", "description": "A test item."}'

Docker Usage

  1. Build the Docker image:
    docker build -t fastapi-sample .
    
  2. Run the container:
    docker run -p 7860:7860 fastapi-sample
    
  3. The app will be available at http://localhost:7860

For more information, see the FastAPI documentation.