File size: 1,979 Bytes
a438e91
 
 
 
 
 
 
 
 
 
 
 
 
 
176e4f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
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==0.1.4
langchain-openai==0.0.5
langgraph==0.0.20
pydantic==2.5.2
streamlit==1.28.0
python-dotenv==1.0.0
```

Install the packages:

```bash
pip install -r requirements.txt
```

## Step 3: Configure Environment Variables

Create a `.env` file in your project directory:

```
OPENAI_API_KEY=your_openai_api_key_here
```

Replace `your_openai_api_key_here` with your actual OpenAI API key.

## 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: