Getting Started - Read.me

The FANA LLM Framework is a sophisticated, scalable solution designed for real-time conversations, image generation, analysis and API-driven services.

FANA LLM Installation Documentation

Prerequisites

  • Docker installed on your machine

  • Basic understanding of Docker and docker-compose workflows

Installation

  1. Clone the Repository

    Begin by cloning the repository to your local machine:

    git clone [repository-url]
    cd [repository-directory]
  2. Environment Setup

    Make sure you have the .env.yourvariables file under the /env/ directory at the root of your project. This file should contain all necessary environment variables. Example structure:

    OPENAI_API_KEY=your_openai_api_key_here
  3. Build and Run the Container

    Use the following Docker command to build and run your application:

    docker compose --env-file ./env/.env.yourvariables up -d --build

Usage

After installation, the FANA LLM Framework will be running and accessible. Below are the common endpoints you might interact with:

  • Base Endpoint: GET https://backend.fana.ai/aimagine/api/v1/

  • Image Generation: POST https://backend.fana.ai/aimagine/api/v1/generate-image/

  • LLM Interaction: POST https://backend.fana.ai/aimagine/api/v1/interact-with-llm/

  • Image Upload: POST https://backend.fana.ai/aimagine/api/v1/upload-image/

  • Image Analysis: POST https://backend.fana.ai/aimagine/api/v1/analyze-image/

API Documentation

Detailed API documentation can be accessed at FANA LLM API Docs. It provides comprehensive details on API usage, parameters, and responses.

Security and Access Controls

  • API Security: Utilizes HTTPS and API key authentication for secure data transmission.

Example API configuration in FastAPI:

@retry(wait=wait_exponential(multiplier=1, min=8, max=64), stop=stop_after_attempt(3))
@router.get(
    "/",
    dependencies=[Depends(RateLimiter(times=15, seconds=60))],
    tags=["api_v1"],
    summary="Read Main Endpoint",
)
def read_main(
    api_key: str = Depends(get_api_key),
):
    return {"msg": "Hello from FANA API V1"}
  • CORS Configuration: Set through FastAPI middleware to safely allow cross-origin requests.

Example CORS configuration in FastAPI:

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

Last updated