👋 Welcome to Xiaojing’s Blog

Hi, this is Xiaojing. I’m documenting my learning notes on AI/ML in this blog.

Enhancing LLM Tool Calling

Tool calling is a critical capability that allows Large Language Models (LLMs) to interact with external systems and perform complex tasks. In this post, we’ll explore practical strategies to enhance LLM tool calling through the lens of building a text-to-SQL application. A Text-to-SQL Case Study Our example application provides a natural language interface to query Hacker news compiled by Mother Duck. The dataset contains user posts, comments, and votes from most of 2022....

November 10, 2024 Â· 6 min Â· Xiaojing Wang

Schema Generation for LLM Function Calling

The rise of Large Language Models (LLMs) has opened up exciting possibilities for automation and natural language interfaces. But to unlock their full potential, we need to connect them with external tools — and that’s where function calling comes in. In this post, we’ll explore how to streamline the process of defining these connections, moving from manual schema writing to automated solutions. Tool Function Definitions When connecting LLMs to external tools, we need two key components: the tool functions themselves and their definitions....

November 8, 2024 Â· 4 min Â· Xiaojing Wang

Semantic Code Search

There’s been a lot of buzz lately about Cursor, particularly its codebase indexing feature. This feature turns Cursor into a context-aware coding assistant. But how does it work, and can we build something similar? Let’s dive in. Understanding Cursor’s Magic Cursor’s codebase indexing, as explained in this forum post, works as follows: It chunks your codebase files locally. These chunks are then sent to Cursor’s server, where embeddings are created using either OpenAI’s embedding API or a custom embedding model....

September 24, 2024 Â· 5 min Â· Xiaojing Wang

Using Anthropic Models with Open WebUI

When it comes to code generation and critique, I’ve found Anthropic’s models to be my top choice. In my experience, they consistently deliver higher quality outputs compared to OpenAI’s GPT-4. Claude.ai, the official WebUI for Anthropic models, provides a streamlined interface for interacting with these models. However, it has a significant drawback: strict rate limits that can be quickly reached. To overcome this rate limit of claude.ai or chatgpt.com, many developers turn to open-source solutions....

August 23, 2024 Â· 4 min Â· Xiaojing Wang

AI Design Pattern: Guardrails

Guardrails in AI are essential controls that ensure AI systems do not generate or process inappropriate content. These controls fall into two categories: input guardrails and output guardrails. Input guardrails filter out unsuitable data before it reaches the AI system, while output guardrails prevent the AI from producing harmful content. In this post, we’ll build on an example from the OpenAI cookbook to create a GenAI chatbot equipped with both input and output guardrails....

August 18, 2024 Â· 9 min Â· Xiaojing Wang