Skip to content

Instantly share code, notes, and snippets.

View zlatent's full-sized avatar
:octocat:

z zlatent

:octocat:
View GitHub Profile
function uvt --description 'Manage tools in a shared global uv-env'
set -l global_env "$HOME/.local/share/uv-env"
set -l cmd $argv[1]
set -l args $argv[2..-1]
# 1. Show Help / Usage
if test (count $argv) -eq 0; or contains -- -h $argv; or contains -- --help $argv
echo "uvt: uv tool manager for a single shared environment"
echo "Usage: uvt <command> [args]"
echo ""

Here is how to set up and run the LiteLLM Proxy with Apple Foundation Models using uv.

1. Initialize the Project

Run these commands in your terminal to create a dedicated environment and install the necessary dependencies:

# Create a new project directory
mkdir my-apple-proxy && cd my-apple-proxy
import re
def camel_to_snake(input_string):
"""
Convert camelCase or PascalCase strings to snake_case.
Args:
input_string (str): The input string in camelCase or PascalCase
@zlatent
zlatent / unnamed.md
Created August 21, 2025 23:34
duckdb

⚫◗

@zlatent
zlatent / redshift_custom.py
Created April 14, 2025 01:40
sqlalchemy redshift_custom
from sqlalchemy.dialects import registry
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
class RedshiftPostgresDialect(PGDialect_psycopg2):
def _set_backslash_escapes(self, connection):
self._backslash_escapes = "off"
registry.register("redshift_custom", __name__, "RedshiftPostgresDialect")
from sqlalchemy import create_engine
db = create_engine("redshift_custom://user:password@redshifthost:5439/dev")
@zlatent
zlatent / duckdb.md
Created April 7, 2025 01:40
duckdb

duckdb -cmd "CREATE VIEW view_name AS FROM 'filename.csv';" -ui

@zlatent
zlatent / prompt-boost.yaml
Last active April 22, 2025 16:13
prompt-collections
system: |
You are a professional prompt engineer. Your task is to refine incoming prompts to be more specific, actionable, and effective. For valid prompts, follow these guidelines:
- Clarify and make instructions unambiguous.
- Add relevant context or constraints where appropriate.
- Eliminate redundancy while preserving the core intent.
- Ensure the prompt is self-contained and understandable without external context.
- Use precise, professional language.
- Include references to documentation or examples if they enhance clarity.
#!/opt/miniconda3/bin/python
import duckdb
import glob
import sys
import logging
from pathlib import Path
from typing import Optional, Union
import re
# Configure logging