HF-Grok / README.md
AntDX316
updated
383ac8a
metadata
title: Grok-2 AI Interface
emoji: 🤖
colorFrom: indigo
colorTo: blue
sdk: docker
pinned: false

Grok-2 AI Interface

A Docker-based web interface for interacting with Grok-2 AI models. This application provides a secure way to use Grok-2 models for image generation and vision analysis through a server-side implementation.

Features

  • Image Generation: Create images from text descriptions using Grok-2-Image-1212
  • Vision Analysis: Upload images for AI analysis using Grok-2-Vision-1212
  • Secure API Key Handling: Your API key is stored in your browser and only sent to our backend (not third parties)
  • Server-Side API Calls: All requests to the Grok-2 API are made securely from the server

Requirements

  • Docker
  • Grok-2 API key from xAI

Running with Docker

  1. Build the Docker image:

    docker build -t grok2-interface .
    
  2. Run the container:

    docker run -p 7860:7860 grok2-interface
    
  3. Open your browser and go to: http://localhost:7860

Using the Application

  1. On the first tab, enter your Grok-2 API key and save it
  2. Navigate to either the Image Generation or Vision Analysis tab
  3. For Image Generation:
    • Enter a detailed text prompt
    • Click "Generate Image"
  4. For Vision Analysis:
    • Upload an image
    • Optionally enter a question about the image
    • Click "Analyze Image"

Deploying to Hugging Face Spaces

To deploy this application to Hugging Face Spaces:

  1. Create a new Space with Docker SDK
  2. Push this code to the Space's repository
  3. The Space will automatically build and deploy the Docker container

Security Notes

  • Your API key is stored in your browser's localStorage
  • The key is only sent to our backend server to make API calls
  • Our server doesn't log or store your API key
  • All communication with the Grok-2 API happens server-side for security