Skip to content

Instantly share code, notes, and snippets.

View limcheekin's full-sized avatar

Lim Chee Kin limcheekin

View GitHub Profile
@limcheekin
limcheekin / curl-embeddings.sh
Last active April 18, 2025 06:09
curl request for embeddings api
curl http://192.168.1.111:8880/embeddings -X POST -H "Content-Type: application/json" -d '{
"input": "This is testing message",
"model": "snowflake-arctic-embed-l-v2.0-gguf"
}' | jq "."
@limcheekin
limcheekin / curl-rerank.sh
Created January 1, 2025 05:17
curl reranker request
curl -X 'POST' \
'http://192.168.1.111:8880/v1/rerank' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"documents": [
"Carson City is the capital city of the American state of Nevada.",
"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.",
"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
@limcheekin
limcheekin / docker-compose.yaml
Created December 11, 2024 07:57
surrealdb docker-compose file
services:
surrealdb:
image: 'surrealdb/surrealdb:latest'
container_name: surrealdb
restart: always
environment:
- SURREALDB_USER
- SURREALDB_PASSWORD
- SURREALDB_DATABASE
volumes:
@limcheekin
limcheekin / analytics_client.dart
Created November 29, 2024 07:47
Flutter Analytics with Mixpanel and Firebase Analytics (quick and dirty approach)
// REF: https://pro.codewithandrea.com/flutter-in-production/05-analytics/05-app-analytics-architecture
import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:mixpanel_flutter/mixpanel_flutter.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
class AnalyticsClient {
const AnalyticsClient(this._analytics, this._mixpanel);
final FirebaseAnalytics _analytics;
@limcheekin
limcheekin / slim-sentiment-tool.yaml
Last active October 31, 2024 07:03
LocalAI llmware model config
name: llmware/slim-sentiment-tool
parameters:
model: llmware/slim-sentiment-tool/slim-sentiment.gguf
temperature: 0.0
context_size: 2048
backend: llama
template:
completion: "<human> {{.Input }} <classify> sentiment </classify>\n<bot>:"
trimsuffix:
@limcheekin
limcheekin / kill-service-at-port.txt
Created October 28, 2024 06:53
Find detail of service running on given port and kill it
# find info of service running in port 8882
lsof -i:8882
# kill it
kill $(lsof -t -i:8882)
@limcheekin
limcheekin / conda-run.sh
Last active September 22, 2025 09:48
Bash script to start FastWhisperAPI
#!/bin/bash
# Check if conda environment is activated
if [[ "$CONDA_PREFIX" != "$(pwd)/.conda" ]]; then
echo "Activating conda environment..."
# Initialize conda for this shell if not already
if ! command -v conda &> /dev/null; then
echo "conda not found in PATH. Make sure Conda is installed and initialized."
exit 1
fi
@limcheekin
limcheekin / .bashrc
Last active October 28, 2024 05:52
Command to start mlc_llm server
# mlc.ai configs in the .bashrc file
export MLC_HOME="/mnt/emmc/ws/mlc.ai"
export TVM_HOME=$MLC_HOME/tvm-unity
export MLC_LLM_HOME=$MLC_HOME/mlc-llm
export PYTHONPATH=$TVM_HOME/python:$MLC_LLM_HOME/python:${PYTHONPATH}
alias mlc_llm="python -m mlc_llm"
@limcheekin
limcheekin / .env
Last active October 28, 2024 05:37
Build local-ai-Linux-arm64 with tts (piper) from source and configs in Ubuntu 24.04
LOCALAI_ADDRESS=":8880"
LOCALAI_BACKEND_ASSETS_PATH="./backend_data"
LOCALAI_CORS="true"
LOCALAI_CORS_ALLOW_ORIGINS="*"
@limcheekin
limcheekin / .env
Last active July 9, 2025 05:21
.env file of Verbi
TRANSCRIPTION_MODEL="fastwhisperapi"
RESPONSE_MODEL="localai"
TTS_MODEL="localai"
OPENAI_API_KEY="OPENAI_API_KEY"
GROQ_API_KEY="GROQ_API_KEY"
DEEPGRAM_API_KEY="DEEPGRAM_API_KEY"
ELEVENLABS_API_KEY="ELEVENLABS_API_KEY"
CARTESIA_API_KEY="CARTESIA_API_KEY"
LOCAL_MODEL_PATH=path/to/local/model
LOCALAI_BASE_URL="http://192.168.1.111:8888/v1"