Skip to content

Instantly share code, notes, and snippets.

View williamcaban's full-sized avatar

William Caban Babilonia williamcaban

View GitHub Profile
@williamcaban
williamcaban / README.md
Created August 13, 2025 02:42
Dummy implementation of OpenAI Responses API endpoints on Kubernetes Gateway API

Kubernetes Gateway API implementation that covers the OpenAI Responses API endpoints based on the current documentation.

Core Response Operations:

  • POST /v1/responses - Create new responses with input, model, and tools
  • GET /v1/responses/{id} - Retrieve response by ID
  • GET /v1/responses/{id} (with Accept: text/event-stream) - Stream responses in real-time
  • POST /v1/responses/{id} - Continue/extend existing responses
  • DELETE /v1/responses/{id} - Delete responses
@williamcaban
williamcaban / RAGAS Evals with KFP Setup Guide.md
Last active July 26, 2025 17:07
RAGAS evaluation using Kubeflow Pipelines

RAGAS Evaluation with Kubeflow Pipelines - Setup Guide

About

The ragas_pipeline.py is a Kubeflow Pipeline (KFP) definition on how to run RAGAS evaluations using KFP.

This pipeline is designed as an example pipeline with charactersitics expected for production environments like proper resource management, monitoring capabilities, and comprehensive documentation. You should adjust the components based on your specific RAG evaluation needs and infrastructure setup.

Key Components:

@williamcaban
williamcaban / convert_1password_to_apply.py
Created April 13, 2025 23:54
Script to convert 1Password8 export to CSV compatible with Apple Password
import csv
import os
def convert_1password_to_apple(input_file, output_file):
"""
Convert a 1Password CSV export file to a format compatible with Apple Passwords.
Apple Passwords import format requires the following columns:
- Title
- URL

RHEL AI 1.1 as Inference Endpoint

Step 1. Update the host_port key serve section of the config.yaml to listen in all interfaces.

...
serve:
  backend: vllm
  chat_template: auto
 host_port: 0.0.0.0:8000
from datasets import load_dataset
# Combine 'question' and 'answer' into a single 'text' field
def combine_qa(local_dataset):
local_dataset['text'] = f"User: {local_dataset['Question']}\nAssistant: {local_dataset['Answer']}"
return local_dataset
####################################################################################
# main
####################################################################################
@williamcaban
williamcaban / dataset_to_ilab.py
Last active July 7, 2024 18:53
Convert a Q&A custom dataset to InstructLab format
#
import sys, json
from pathlib import Path
from datetime import datetime
import pandas as pd
TSTAMP = datetime.now().replace(microsecond=0).isoformat().replace(":", '_')
ILABGEN = "granite-7b-lab-7b-Q4_K_M"+f"_{TSTAMP}"
DEBUG = True
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@williamcaban
williamcaban / api-access-from-jumphost.yaml
Last active April 5, 2024 01:17
Example of limiting the access to OpenShift control-plane, Kube API and SSH to control plane nodes using the Ingress Node Firewall Operator
---
apiVersion: ingressnodefirewall.openshift.io/v1alpha1
kind: IngressNodeFirewallConfig
metadata:
name: ingressnodefirewallconfig
namespace: openshift-ingress-node-firewall
spec:
nodeSelector:
node-role.kubernetes.io/control-plane: ""
---
  • Installing the Redis Operator
# create namespace for operator
oc create ns redis-operator

# register Helm repo
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/

# install redis-operator using helm
helm upgrade redis-operator ot-helm/redis-operator \

Static routes in MacOS

  • Find the name of the network adapters
# List network interface name
networksetup -listallnetworkservices

An asterisk (*) denotes that a network service is disabled.
USB 10/100/1000 LAN