Spaces:
Sleeping
Sleeping
title: Blog Generator | |
emoji: 🏢 | |
colorFrom: blue | |
colorTo: indigo | |
sdk: streamlit | |
sdk_version: 1.43.1 | |
app_file: app.py | |
pinned: false | |
license: mit | |
short_description: 'AI Blog generator with Openai and Groq support. ' | |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
# Deploying Your LangGraph Blog Generator | |
This guide will walk you through setting up and deploying your LangGraph blog generator application. | |
## Prerequisites | |
- Python 3.9+ installed | |
- pip (Python package installer) | |
- Git (optional, for version control) | |
## Step 1: Set Up Your Environment | |
First, create a project directory and set up a virtual environment: | |
```bash | |
# Create project directory | |
mkdir langgraph-blog-generator | |
cd langgraph-blog-generator | |
# Create and activate virtual environment | |
python -m venv venv | |
# On Windows | |
venv\Scripts\activate | |
# On macOS/Linux | |
source venv/bin/activate | |
``` | |
## Step 2: Install Required Packages | |
Create a `requirements.txt` file with the following content: | |
``` | |
langchain | |
langchain-openai | |
langchain_groq | |
langgraph | |
pydantic | |
streamlit | |
python-dotenv | |
``` | |
Install the packages: | |
```bash | |
pip install -r requirements.txt | |
``` | |
## Step 3: Configure Environment Variables | |
Added sidebar integration to deployed version so you can paste your OpenAi API keys or alternatively can use the Groq API keys to run space. | |
Paste your OpenAi API key and choose the model, or similarly the Groq API key and the model you want to use for the inferences. | |
 | |
## Step 4: Create the Application File | |
Create a file named `app.py` and paste the code from the LangGraph Blog Generator code artifact. | |
## Step 5: Run Locally | |
Test the application locally: | |
```bash | |
streamlit run app.py | |
``` | |
Your browser should open automatically to `http://localhost:8501` with the blog generator app running. | |
## Step 6: Deployment | |
1. Create a free account on hugginface | |
2. Add requirements.txt | |
3. Add the files to the spaces | |
4. Build the dependencies | |
5. Deploy the app | |
Alternatively, you can deploy to other platforms: | |