Skip to content

Instantly share code, notes, and snippets.

@santoshdahale
santoshdahale / main.py
Created April 4, 2025 13:19 — forked from jcanizalez/main.py
Prometheus Langchain Agent
from langchain.tools import BaseTool
from typing import Optional
from pydantic import BaseModel, Field
from langchain_openai.chat_models import ChatOpenAI
from langchain.agents import initialize_agent
import requests
class PrometheusQueryToolConfig(BaseModel):
prometheus_url: str = Field(default="http://localhost:9090")

Security Checklist

Configuration Security

  • Store secrets in environment variables or dedicated secret management systems
  • Never commit secrets to version control
  • Implement secret rotation policies
  • Use different credentials for different environments
  • Encrypt sensitive configuration values

Authentication & Authorization

@santoshdahale
santoshdahale / grpo_demo.py
Created January 31, 2025 01:43 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset