Spaces:
Sleeping
Sleeping
Download llm.py from KrishnaHuYaar/Taskify-AI: direct link, hf CLI and curl.
- Browser
- Download file 416 Bytes
-
https://huggingface.co/spaces/KrishnaHuYaar/Taskify-AI/resolve/main/llm.py
- Command line
-
hf download hf://spaces/KrishnaHuYaar/Taskify-AI/llm.py
-
curl -L -o llm.py https://huggingface.co/spaces/KrishnaHuYaar/Taskify-AI/resolve/main/llm.py
416 Bytes
| import os | |
| from langchain_openai import ChatOpenAI | |
| def get_llm(): | |
| return ChatOpenAI( | |
| model="meta-llama/llama-3-8b-instruct", | |
| api_key=os.getenv("OPENROUTER_API_KEY"), | |
| base_url="https://openrouter.ai/api/v1", | |
| default_headers={ | |
| "HTTP-Referer": "https://huggingface.co", | |
| "X-Title": "Taskify AI" | |
| }, | |
| temperature=0.4, | |
| max_tokens=700 | |
| ) | |