File size: 2,177 Bytes
a438e91
 
 
 
 
 
 
 
 
 
 
 
 
 
176e4f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df76dc4
 
 
 
 
 
 
176e4f8
 
 
 
 
 
 
 
 
 
cb08f94
176e4f8
cb08f94
176e4f8
 
13af76d
 
 
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
105
---
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.


![image/png](https://cdn-uploads.huggingface.co/production/uploads/66aa6865dbc76cb4ea6e789e/82ohVcQJsUXh9AGiLpm3Y.png)


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