Skip to content

Instantly share code, notes, and snippets.

View rajivmehtaflex's full-sized avatar
🚀
smile

Rajiv Mehta rajivmehtaflex

🚀
smile
  • Bacancy Technology
  • Ahmedabad
View GitHub Profile
@rajivmehtaflex
rajivmehtaflex / HF_AS_OPENAI.py
Last active February 16, 2025 15:27
smolagents - Example
from langchain_openai import ChatOpenAI
model=ChatOpenAI(
temperature=0.5,
model='codellama/CodeLlama-34b-Instruct-hf',
base_url='https://api-inference.huggingface.co/v1/',
api_key='<KEY>'
)
response=model.invoke(input=[{"role": "user", "content": "What is color of flamingo?"}])
@rajivmehtaflex
rajivmehtaflex / openai_references.txt
Last active January 14, 2025 03:45
UV-Python-Manager
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="gemini-1.5-flash-002",
api_key='<KEY>',
base_url="https://generativelanguage.googleapis.com/v1beta/",
temperature=0,
max_tokens=None,
timeout=None,
max_retries=2,
@rajivmehtaflex
rajivmehtaflex / Clasp-Installation-Steps.md
Last active November 2, 2024 16:39
Google App Script References

Google Apps Script with Clasp CLI - Quick Reference

This Gist documents the steps and commands used to set up and manage a Google Apps Script project using the clasp CLI.

Installation and Setup

1. Verify Node.js Installation

node -v
@rajivmehtaflex
rajivmehtaflex / tunnel.sh
Last active October 9, 2024 09:19
Remote-Tunneling setup for vscode server
apt update && apt dist-upgrade -y && apt install curl htop neofetch git watch wget nano tmux tree jq -y
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz
chmod +x code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rajivmehtaflex
rajivmehtaflex / Code-Automation-.aider.config.yml
Last active November 2, 2024 16:38
Colab-Dev-Setup script
openai-api-key: <KEY>
openai-api-base: https://api.hyperbolic.xyz/v1
model: openai/deepseek-ai/DeepSeek-V2.5
architect: true
weak-model: openai/meta-llama/Meta-Llama-3.1-8B-Instruct
editor-model: openai/Qwen/Qwen2.5-72B-Instruct
show-model-warnings: false
# Repomap Settings:
# Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
map-tokens: 2048
@rajivmehtaflex
rajivmehtaflex / install_terraform.sh
Created September 18, 2024 08:53
terraform installation script
#!/bin/bash
# install_terraform.sh
# Exit immediately if a command exits with a non-zero status
set -e
# Update the package index
echo "Updating package index..."
sudo apt-get update
@rajivmehtaflex
rajivmehtaflex / LLM_tool_call_any_LLM.py
Created August 10, 2024 14:11
Base Tool Calling process.
import ollama
import json
show_message_tool: dict = {
"name": "show_message",
"description": "Display a greeting message with the given parameter",
"parameters": [
{
"name": "param",
"description": "The parameter to include in the greeting message",
@rajivmehtaflex
rajivmehtaflex / sqlitevec_exp.py
Created August 4, 2024 12:37
a vector search SQLite extension
# %%
# !pip install sqlite-vec
### [Ref Link](https://alexgarcia.xyz/blog/2024/sqlite-vec-stable-release/index.html)
import sqlite3
import sqlite_vec
import numpy as np
import struct
@rajivmehtaflex
rajivmehtaflex / KeyBoard-shortcut.txt
Last active August 3, 2024 12:37
IPython-VSCode-Base-Suggestion
In Visual Studio Code, the keyboard shortcuts to move to the previous (and next) cursor location are:
For Windows and Linux:
Go to previous location: Ctrl + Alt + - (minus)
Go to next location: Ctrl + Shift + - (minus)
For macOS:
Go to previous location: Ctrl + - (minus)
Go to next location: Ctrl + Shift + - (minus)