Skip to content

Commit

Permalink
Added examples of controller-config.yaml/workflow-config.yaml and upd…
Browse files Browse the repository at this point in the history
…ated quick start (#30)

* Added examples of controller-config.yaml/workflow-config.yaml and missing chromadb dependency

* Updated quickstart
  • Loading branch information
nschenone authored Oct 1, 2024
1 parent 90887a6 commit b575935
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 27 deletions.
5 changes: 5 additions & 0 deletions controller/controller-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
verbose: true
log_level: DEBUG
db_type: sql
sql_connection_str: sqlite:////data/sql.db
application_url: http://localhost:8000
2 changes: 1 addition & 1 deletion controller/src/controller/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CtrlConfig(BaseModel):
def print(self):
print(yaml.dump(self.dict()))

# @classmethod
@classmethod
def load_from_yaml(cls, path: str):
with open(path, "r") as f:
data = yaml.safe_load(f)
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ services:
environment:
- PYTHONPATH=/controller/src
- CTRL_DATA_PATH=/data
- CTRL_CONFIG_PATH=/controller-config.yaml
volumes:
- ./controller/controller-config.yaml:/controller-config.yaml
networks:
- app-network

Expand Down
64 changes: 38 additions & 26 deletions examples/quick_start/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"outputs": [],
"source": [
"# Install MLRun from the feature branch\n",
"!pip install git+https://github.com/mlrun/genai-factory.git"
"!pip install git+https://github.com/mlrun/genai-factory.git\n",
"!pip install -r requirements.txt"
]
},
{
Expand All @@ -44,15 +45,15 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7bb4a98dcb31cae1",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Set the path for the environment file\n",
"!export GENAI_FACTORY_ENV_PATH=$(pwd)/.env"
],
"metadata": {
"collapsed": false
},
"id": "7bb4a98dcb31cae1"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -82,17 +83,17 @@
},
{
"cell_type": "markdown",
"id": "61b0c86cc526df30",
"metadata": {
"collapsed": false
},
"source": [
"```bash\n",
"make genai-factory\n",
"```\n",
"\n",
"Run the above command in your terminal to deploy the GenAI Factory."
],
"metadata": {
"collapsed": false
},
"id": "61b0c86cc526df30"
]
},
{
"cell_type": "markdown",
Expand All @@ -113,6 +114,17 @@
"!genai-factory run workflow.py"
]
},
{
"cell_type": "markdown",
"id": "90a418bd",
"metadata": {},
"source": [
"Optionally make modifications to `workflow-config.yaml` and run like so\n",
"```shell\n",
"genai-factory run --config-path workflow-config.yaml workflow.py\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "2cf33b47-f313-46dd-a5d6-2c0359cc7296",
Expand All @@ -125,22 +137,26 @@
},
{
"cell_type": "markdown",
"id": "88d5b8ffda9bbe8b",
"metadata": {
"collapsed": false
},
"source": [
"Run the following command in your terminal while inside the controller container:\n",
"Run the following command in your terminal while inside the **controller container**:\n",
"\n",
"```bash\n",
"python -m controller ingest -l web https://docs.mlrun.org/en/stable/index.html\n",
"```\n",
"\n",
"This command will ingest the MLRun documentation from the specified URL."
],
"metadata": {
"collapsed": false
},
"id": "88d5b8ffda9bbe8b"
]
},
{
"cell_type": "markdown",
"id": "6ca5be89df585ac1",
"metadata": {
"collapsed": false
},
"source": [
"## Conclusion: Exploring the GenAI Factory UI\n",
"\n",
Expand All @@ -155,26 +171,22 @@
"Remember, the UI is your gateway to interacting with the GenAI Factory. It provides a visual and interactive way to manage your AI and machine learning tasks, monitor performance, and gain insights from your data.\n",
"\n",
"Feel free to refer back to the documentation if you need help understanding any specific features or functionalities you encounter in the UI."
],
"metadata": {
"collapsed": false
},
"id": "6ca5be89df585ac1"
]
},
{
"cell_type": "markdown",
"source": [],
"id": "ce9f1015a62080a5",
"metadata": {
"collapsed": false
},
"id": "ce9f1015a62080a5"
"source": []
}
],
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3 (ipykernel)"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
1 change: 1 addition & 0 deletions examples/quick_start/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chromadb==0.5.3
20 changes: 20 additions & 0 deletions examples/quick_start/workflow-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
chunk_overlap: 20
chunk_size: 1024
controller_url: http://localhost:8001
controller_username: guest
default_llm:
class_name: langchain_openai.ChatOpenAI
model_name: gpt-3.5-turbo
temperature: 0
default_vector_store:
class_name: chroma
collection_name: default
persist_directory: /tmp/chromadb/chroma
deployment_url: http://localhost:8000
embeddings:
class_name: huggingface
model_name: all-MiniLM-L6-v2
log_level: INFO
project_name: default
verbose: true
workflows_kwargs: {}

0 comments on commit b575935

Please sign in to comment.