Prompt engineering involves the design and creation of prompts that are used to elicit specific responses or actions from AI models or interactive systems. These prompts are carefully crafted to guide the behavior or generate particular outputs from the AI, such as generating natural language responses, providing recommendations, or completing specific tasks.
In the context of AI language models, prompt engineering is especially important for shaping the model's behavior and output. By designing prompts effectively, engineers can influence the model's responses and ensure that it generates coherent, relevant, and accurate content.
There are four main areas to consider when writing an effective prompt. You don’t need to use all four, but using a few will help!
Persona: Who is the user you're writing for? What are their skills and knowledge?
Task: What specific action do you want the user to perform?
Context: What information does the user need to know to complete the task?
Format: What is the desired output of the task?
Example Prompt:
[Persona] You are a Google Cloud program manager.
[Task] Draft an executive summary email
[Context] to [person description] based on [details about relevant program docs].
[Format] Limit to bullet points.
By using "act as," you are establishing a specific context for the language model and guiding it to understand the type of task or request you are making. This helps to set the right expectations and provides the language model with the necessary context to generate a response tailored to the defined role.
"Act as a creative writing assistant and generate a short story based
+on a prompt about a futuristic world where robots have become sentient."
+
Summary is a prompt engineering technique that involves providing a summary of a given document or text. It can helps for summarizing changelogs, articles, or other technical documents.
Help me write an article of this document [Insert or copy paste document text]
+Generate 5 titles out of the following topic….
+Generate a subtitle to catch readers’ attention on the following
+topic [describe the topic]
+
Write is a prompt engineering technique that involves providing a step-by-step guide or instructions for a given task or process. Its useful for developers to create functional and technical documentations.
Create a template of an email response to customer inquiring about ….
+Create a guide that explains how to use ….
+Write step by step instructions
+
Code explanation is a prompt engineering technique that involves providing a detailed explanation of a code snippet or function. This technique is useful for developers who want to understand the inner workings of a codebase or for those who want to document their code.
cf. Preformatted prompts for an example of code explanation
Code completion is a prompt engineering technique that involves providing a list of possible completions for a given code snippet or function. This technique is useful for developers who want to suggest possible code changes or improvements based on their existing code.
Code conversion is a prompt engineering technique that involves providing a conversion of a code snippet or function from one programming language to another. This technique is useful for developers who want to migrate their code from one language to another or for those who want to use a different programming language for their projects.
Code review is a prompt engineering technique that involves providing a code review of a given code snippet or function. This technique is useful for developers who want to review their code for potential issues,bugs, or for those who want to provide feedback on their code.
Code fixing is a prompt engineering technique that involves providing a code fix for a given code snippet or function. This technique is useful for developers who want to fix bugs or issues in their code or for those who want to improve the quality of their code.
Help me find mistakes in my code [insert your code]
+Explain what this snippet of code does [insert code snippet]
+What it the correct syntax for a [statement or function]
+in [programming language]
+How do I fix the following programming language code
+[program language] code which explain the functioning [Insert code snippet]
+
Code refactor is a prompt engineering technique that involves providing a code refactoring of a given code snippet or function within a specific scope. This technique is useful for developers who want to refactor their code within a specific context or for those who want to improve the readability and maintainability of their code.
Mock data generation is a prompt engineering technique that involves providing a mock data set for a given code snippet or function. This technique is useful for developers who want to test their code with mock data or for those who want to generate test data for their projects. It avoid creating manually fake data for testing.
Testing is a prompt engineering technique that involves providing a test case for a given code snippet or function. This technique is useful for developers who want to test their code or for those who want to ensure the correctness of their code.
System design and architecture is a prompt engineering technique that involves providing a system design or architecture for a given code snippet or function. This technique is useful for developers who want to design their code or for those who want to understand the overall architecture of their projects.
Documentation generation is a prompt engineering technique that involves providing a documentation for a given code snippet or function. This technique is useful for developers who want to document their code or for those who want to provide documentation for their projects. It can be used to generate documentation in various formats such as Markdown, HTML, or PDF.
Commit message generation is a prompt engineering technique that involves providing a commit message for a given code snippet or function. This technique is useful for developers who want to generate commit messages for their code or for those who want to ensure that their commit messages are clear and concise.
Vulnerability checking is a prompt engineering technique that involves providing a vulnerability check for a given code snippet or function. This technique is useful for developers who want to check for vulnerabilities in their code or for those who want to ensure that their code is secure.
Warning
This prompt is not recommended for production use. It is intended for testing and debugging purposes only and is not a proof of security or safety of your app.
You can understand complex regular expressions and generate ones that match specific patterns in text. This technique is useful for developers who want to write complex regular expressions or for those who want to understand the syntax of regular expressions.
Explain this regular expression in JavaScript: const regex =
+/^[A-Za-z0–9._%+-]+@[A-Za-z0–9.-]+\\\\.[A-Za-z]{2,}$/;
+
Create a function that calculates the factorial of a number.
Handle both positive integers and zero, with error handling for negative inputs.
Expected Output (python)
deffactorial(n):
+if n <0:
+raise ValueError("Input must be a non-negative integer.")
+if n ==0:
+return1
+ result =1
+for i inrange(1, n +1):
+ result *= i
+return result
+
Create prompts that can generate mock user profiles. The language used is JavaScript.
The profile should include:
Name
Age
Email
Address (Street, City, State, Zip Code)
Phone Number
Solutions
Exercise 1: Basic Function Creation
Persona: Python Developer Task: Create a function Context: You need to calculate the factorial of a number.
As a Python Developer, create a function named factorial that takes a single integer input and returns its factorial. The function should handle both positive integers and zero. Include error handling for negative inputs.
Exercise 2: API Request Handling
Persona: JavaScript Developer Task: Write a function to handle API requests Context: You need to fetch data from a given URL.
As a JavaScript Developer, write a function named fetchData that takes a URL as an argument and fetches data from that URL using the Fetch API. The function should return the JSON response and handle any errors that may occur during the fetch operation.
Exercise 3: Class Definition
Persona: C# Developer Task: Define a class Context: You are creating a representation of a book.
As a C# Developer, create a class named Book that has properties for Title, Author, and PublicationYear. Include a method named DisplayDetails that prints the book's details in a formatted string.
Exercise 4: Simple Web Server
Persona: JavaScript Developer Task: Set up a web server Context: You need to create a simple server that responds to requests.
As a JavaScript Developer, set up a simple web server using the http module that listens on port 3000 and responds with "Hello, World!" when accessed.
Exercise 5: Data Validation
Persona: Ruby Developer Task: Write a validation method Context: You need to validate email addresses.
As a Ruby Developer, write a method named valid_email? that takes a string as input and returns true if it is a valid email address, and false otherwise. Use a regular expression for validation.
Exercise 6: Mock Data Generation
As a JavaScript Developer, write a function named generateUserProfile that generates a mock user profile with the following details: name, age, email, address, and phone number. The function should return an object containing the user profile details.
`,81)]))}const r=s(i,[["render",o],["__file","index.html.vue"]]),c=JSON.parse('{"path":"/use/","title":"Prompt with AI","lang":"en-US","frontmatter":{"description":"Prompt with AI Prompt engineering Prompt engineering involves the design and creation of prompts that are used to elicit specific responses or actions from AI models or interact...","head":[["meta",{"property":"og:url","content":"https://worldline.github.io/worldline/learning-ai/learning-ai/use/"}],["meta",{"property":"og:title","content":"Prompt with AI"}],["meta",{"property":"og:description","content":"Prompt with AI Prompt engineering Prompt engineering involves the design and creation of prompts that are used to elicit specific responses or actions from AI models or interact..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-11-20T13:15:23.000Z"}],["meta",{"property":"article:modified_time","content":"2024-11-20T13:15:23.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Prompt with AI\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-11-20T13:15:23.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Prompt engineering","slug":"prompt-engineering","link":"#prompt-engineering","children":[{"level":3,"title":"Definition","slug":"definition","link":"#definition","children":[]},{"level":3,"title":"Summarize","slug":"summarize","link":"#summarize","children":[]},{"level":3,"title":"Write","slug":"write","link":"#write","children":[]}]},{"level":2,"title":"For Developers","slug":"for-developers","link":"#for-developers","children":[{"level":3,"title":"Code explanation","slug":"code-explanation","link":"#code-explanation","children":[]},{"level":3,"title":"Generation","slug":"generation","link":"#generation","children":[]},{"level":3,"title":"Completion","slug":"completion","link":"#completion","children":[]},{"level":3,"title":"Conversion","slug":"conversion","link":"#conversion","children":[]},{"level":3,"title":"Review","slug":"review","link":"#review","children":[]},{"level":3,"title":"Fixing","slug":"fixing","link":"#fixing","children":[]},{"level":3,"title":"Refactoring","slug":"refactoring","link":"#refactoring","children":[]},{"level":3,"title":"Data mocking","slug":"data-mocking","link":"#data-mocking","children":[]}]},{"level":2,"title":"Go further","slug":"go-further","link":"#go-further","children":[{"level":3,"title":"Testing","slug":"testing","link":"#testing","children":[]},{"level":3,"title":"System design and architecture","slug":"system-design-and-architecture","link":"#system-design-and-architecture","children":[]},{"level":3,"title":"Documentation generation","slug":"documentation-generation","link":"#documentation-generation","children":[]},{"level":3,"title":"Commit Message Generation","slug":"commit-message-generation","link":"#commit-message-generation","children":[]},{"level":3,"title":"Vulnerability checking","slug":"vulnerability-checking","link":"#vulnerability-checking","children":[]},{"level":3,"title":"Shell/CLI commands manual","slug":"shell-cli-commands-manual","link":"#shell-cli-commands-manual","children":[]},{"level":3,"title":"Regular expression explanation","slug":"regular-expression-explanation","link":"#regular-expression-explanation","children":[]}]},{"level":2,"title":"🧪 Exercises","slug":"🧪-exercises","link":"#🧪-exercises","children":[{"level":3,"title":"Exercise 1: Basic Function Creation","slug":"exercise-1-basic-function-creation","link":"#exercise-1-basic-function-creation","children":[]},{"level":3,"title":"Exercise 2: API Request Handling","slug":"exercise-2-api-request-handling","link":"#exercise-2-api-request-handling","children":[]},{"level":3,"title":"Exercise 3: Class Definition","slug":"exercise-3-class-definition","link":"#exercise-3-class-definition","children":[]},{"level":3,"title":"Exercise 4: Simple Web Server","slug":"exercise-4-simple-web-server","link":"#exercise-4-simple-web-server","children":[]},{"level":3,"title":"Exercise 5: Data Validation","slug":"exercise-5-data-validation","link":"#exercise-5-data-validation","children":[]},{"level":3,"title":"Exercise 6: Mock Data Generation","slug":"exercise-6-mock-data-generation","link":"#exercise-6-mock-data-generation","children":[]}]}],"git":{"updatedTime":1732108523000,"contributors":[{"name":"Brah","email":"brah.gharbi@gmail.com","commits":6,"url":"https://github.com/Brah"},{"name":"Ibrahim Gharbi","email":"brah.gharbi@gmail.com","commits":2,"url":"https://github.com/Ibrahim Gharbi"}]},"filePathRelative":"use/README.md","autoDesc":true}');export{r as comp,c as data};
diff --git a/assets/index.html-BvklKyMd.js b/assets/index.html-BvklKyMd.js
new file mode 100644
index 0000000..2bd7d62
--- /dev/null
+++ b/assets/index.html-BvklKyMd.js
@@ -0,0 +1 @@
+import{_ as t,c as a,a as r,o as n}from"./app-DkfO46MA.js";const o="/learning-ai/assets/logo_worldline-t5KadDQv.png",i="/learning-ai/assets/avatar-Bf9zzubu.png",l={};function s(h,e){return n(),a("div",null,e[0]||(e[0]=[r('
Disclamer
LLMs and MMLLMs are constantly evolving, and new applications for developer training are emerging all the time.
We design payments technology that powers the growth of millions of businesses around the world. Engineering the next frontiers in payments technology
GitHub Spark is an AI-powered tool for creating and sharing micro apps (“sparks”), which can be tailored to your exact needs and preferences, and are directly usable from your desktop and mobile devices. Without needing to write or deploy any code.
And it enables this through a combination of three tightly-integrated components:
An NL-based editor, which allows easily describing your ideas, and then refining them over time A managed runtime environment, which hosts your sparks, and provides them access to data storage, theming, and LLMs A PWA-enabled dashboard, which lets you manage and launch your sparks from anywhere
`,36)]))}const h=a(o,[["render",r],["__file","index.html.vue"]]),c=JSON.parse('{"path":"/develop/","title":"Develop with AI","lang":"en-US","frontmatter":{"description":"Develop with AI Github Copilot Update Copilot can now use other LLMs than OpenAI, including Google, and Anthropic to provide code suggestions Github Copilot is a tool that uses ...","head":[["meta",{"property":"og:url","content":"https://worldline.github.io/worldline/learning-ai/learning-ai/develop/"}],["meta",{"property":"og:title","content":"Develop with AI"}],["meta",{"property":"og:description","content":"Develop with AI Github Copilot Update Copilot can now use other LLMs than OpenAI, including Google, and Anthropic to provide code suggestions Github Copilot is a tool that uses ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-11-20T13:15:23.000Z"}],["meta",{"property":"article:modified_time","content":"2024-11-20T13:15:23.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Develop with AI\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-11-20T13:15:23.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Github Copilot","slug":"github-copilot","link":"#github-copilot","children":[{"level":3,"title":"Copilot Chat","slug":"copilot-chat","link":"#copilot-chat","children":[]},{"level":3,"title":"CLI","slug":"cli","link":"#cli","children":[]},{"level":3,"title":"JetBrains integration","slug":"jetbrains-integration","link":"#jetbrains-integration","children":[]},{"level":3,"title":"VSCode integration","slug":"vscode-integration","link":"#vscode-integration","children":[]}]},{"level":2,"title":"Gihub Spark","slug":"gihub-spark","link":"#gihub-spark","children":[]},{"level":2,"title":"🧪 Exercises","slug":"🧪-exercises","link":"#🧪-exercises","children":[]},{"level":2,"title":"📖 Further readings","slug":"📖-further-readings","link":"#📖-further-readings","children":[]}],"git":{"updatedTime":1732108523000,"contributors":[{"name":"Brah","email":"brah.gharbi@gmail.com","commits":1,"url":"https://github.com/Brah"},{"name":"Ibrahim Gharbi","email":"brah.gharbi@gmail.com","commits":3,"url":"https://github.com/Ibrahim Gharbi"}]},"filePathRelative":"develop/README.md","autoDesc":true}');export{h as comp,c as data};
diff --git a/assets/index.html-D0-PoVlK.js b/assets/index.html-D0-PoVlK.js
new file mode 100644
index 0000000..0ad5543
--- /dev/null
+++ b/assets/index.html-D0-PoVlK.js
@@ -0,0 +1 @@
+import{_ as i,o as a,c as o,a as n}from"./app-DkfO46MA.js";const t={};function r(s,e){return a(),o("div",null,e[0]||(e[0]=[n('
For basic APIs exchange with LibreChat, you can use simple HTTP requests. You can use the /api/v1/chat/completions endpoint to send a request to the API and receive a response.
GCP is a suite of cloud computing services provided by Google. It includes a wide range of tools and services for building and consuming LLMs, such as Vertex AI, Google Colab, and ML Flow.
These products are directly available to consumers, often integrating AI capabilities into everyday applications:
Google Colaboratory (Colab): A free Jupyter Notebook environment hosted by Google. Excellent for learning, experimentation, and sharing machine learning code. While not a "production" platform like Vertex AI, it's extremely popular for its ease of use and free access to compute resources (though with limitations).
Gemini: Google's large language model (LLM), positioned as a competitor to OpenAI's GPT models. Gemini's capabilities are integrated into various Google products and services, and are also accessible through APIs. Different versions of Gemini (e.g., Gemini Pro, Gemini Ultra) offer varying levels of capability and access. It powers several consumer-facing features across Google's ecosystem.
AI Studio Cloud-based machine learning platform offered by several companies, most notably Google with its Google AI Studio (now largely integrated into Vertex AI) and Amazon with Amazon SageMaker Studio. While both share the general goal of providing a user-friendly environment for building, training, and deploying machine learning models, their specific features and offerings differ. https://aistudio.google.com/
This is the central hub for most Google Cloud's AI/ML services. It integrates and supersedes many previous offerings.
Vertex AI Training: Training machine learning models using various algorithms and frameworks (TensorFlow, PyTorch, scikit-learn, XGBoost, etc.). Provides access to managed compute instances (including TPUs).
Vertex AI Prediction: Deploying trained models for inference (making predictions). Offers different deployment options based on scale and latency requirements.
Vertex AI Pipelines: Creating and managing machine learning workflows, including data preprocessing, model training, evaluation, and deployment, as a series of connected steps.
Vertex AI Model Monitoring: Monitoring deployed models for performance degradation and potential issues (drift).
Vertex AI Feature Store: Centralized repository for storing, managing, and versioning features used in machine learning models, improving collaboration and reuse.
Vertex AI Matching Engine: A service for performing similarity searches (for example, recommendation systems).
Pre-trained Models and APIs: Google offers numerous pre-trained models and APIs for various tasks, making it easier to integrate AI into applications without building models from scratch. Examples include:
Google Cloud Natural Language API: Processing and understanding text (sentiment analysis, entity recognition, etc.). Google Cloud Vision API: Analyzing images (object detection, image classification, optical character recognition, etc.).
Google Cloud Speech-to-Text API: Converting audio to text.
Google Cloud Text-to-Speech API: Converting text to audio.
Google Cloud Translation API: Translating text between languages.
Other APIs: Many more APIs exist for various tasks like video intelligence, dialogflow (conversational AI), and more.
Beyond the core platform and APIs, Google offers several specialized AI products:
TensorFlow: A popular open-source machine learning framework developed by Google. While not strictly a "Google Cloud" product, it's deeply integrated with their services.
TensorFlow Extended (TFX): A platform for deploying TensorFlow models at scale, often used in conjunction with Vertex AI.
JAX: A high-performance machine learning library, often used for research and advanced applications.
Google AI Platform Notebooks (integrated into Vertex AI): Jupyter Notebook environments hosted on Google Cloud. (Previously a separate offering, often confused with Google Colab.)
Dialogflow CX: A conversational AI platform for building complex conversational experiences.
MLflow provides tools for managing experiments, tracking model versions, deploying models to various environments, and managing models in a central registry. It's designed to be platform-agnostic, meaning it can work with many different cloud providers and even on-premises infrastructure.
Function calling is a feature that allows you to call functions from other services. It is useful for working with functions, such as APIs, and for interacting with models that require function calls.
To use function calling, you need to specify the function name and arguments in the prompt.
Json mode is a feature that allows you to send structured data to the model. It is useful for working with structured data, such as JSON objects, and for interacting with models that require structured input.
To use Json mode, you need to specify the input format as JSON in the prompt. You can do this by adding the following line to the beginning of your prompt:
The platform where the machine learning community collaborates on models, datasets, and applications.
Hugging Face is a platform for researchers and developers to share, explore, and build AI models. It provides a centralized repository for models, datasets, and applications, making it easy to find, use, and contribute to the growing ecosystem of AI technologies.
Creating/deploy/customize a model
Pre-trained model, use behind the APIs, also a ML part, training model generation for use
',34)]))}const c=i(t,[["render",r],["__file","index.html.vue"]]),d=JSON.parse('{"path":"/services/","title":"AI for services","lang":"en-US","frontmatter":{"description":"AI for services APIs with LibreChat For basic APIs exchange with LibreChat, you can use simple HTTP requests. You can use the /api/v1/chat/completions endpoint to send a request...","head":[["meta",{"property":"og:url","content":"https://worldline.github.io/worldline/learning-ai/learning-ai/services/"}],["meta",{"property":"og:title","content":"AI for services"}],["meta",{"property":"og:description","content":"AI for services APIs with LibreChat For basic APIs exchange with LibreChat, you can use simple HTTP requests. You can use the /api/v1/chat/completions endpoint to send a request..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-11-20T13:15:23.000Z"}],["meta",{"property":"article:modified_time","content":"2024-11-20T13:15:23.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"AI for services\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-11-20T13:15:23.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"APIs with LibreChat","slug":"apis-with-librechat","link":"#apis-with-librechat","children":[]},{"level":2,"title":"CloudAI with GCP","slug":"cloudai-with-gcp","link":"#cloudai-with-gcp","children":[{"level":3,"title":"Large Consumer-Facing","slug":"large-consumer-facing","link":"#large-consumer-facing","children":[]},{"level":3,"title":"Vertex AI","slug":"vertex-ai","link":"#vertex-ai","children":[]},{"level":3,"title":"Google Cloud APIs","slug":"google-cloud-apis","link":"#google-cloud-apis","children":[]},{"level":3,"title":"Specialized AI Products","slug":"specialized-ai-products","link":"#specialized-ai-products","children":[]}]},{"level":2,"title":"Manage models (ML Flow)","slug":"manage-models-ml-flow","link":"#manage-models-ml-flow","children":[]},{"level":2,"title":"Function calling (langchain4j)","slug":"function-calling-langchain4j","link":"#function-calling-langchain4j","children":[]},{"level":2,"title":"Structured Outputs (Json Mode)","slug":"structured-outputs-json-mode","link":"#structured-outputs-json-mode","children":[]},{"level":2,"title":"Advanced RAG (llama-index)","slug":"advanced-rag-llama-index","link":"#advanced-rag-llama-index","children":[]},{"level":2,"title":"Collaborative (Hugging Face)","slug":"collaborative-hugging-face","link":"#collaborative-hugging-face","children":[]},{"level":2,"title":"🧪 Exercises","slug":"🧪-exercises","link":"#🧪-exercises","children":[]},{"level":2,"title":"📖 Further readings","slug":"📖-further-readings","link":"#📖-further-readings","children":[]}],"git":{"updatedTime":1732108523000,"contributors":[{"name":"Brah","email":"brah.gharbi@gmail.com","commits":1,"url":"https://github.com/Brah"},{"name":"Ibrahim Gharbi","email":"brah.gharbi@gmail.com","commits":4,"url":"https://github.com/Ibrahim Gharbi"}]},"filePathRelative":"services/README.md","autoDesc":true}');export{c as comp,d as data};
diff --git a/assets/index.html-D0QgU6oo.js b/assets/index.html-D0QgU6oo.js
new file mode 100644
index 0000000..b8cad0d
--- /dev/null
+++ b/assets/index.html-D0QgU6oo.js
@@ -0,0 +1,6 @@
+import{_ as a,o as t,c as i,a as n}from"./app-DkfO46MA.js";const s="/learning-ai/assets/librechat_interface-CYKYbYEb.png",r="/learning-ai/assets/prompt-D9YI1LJh.png",o="/learning-ai/assets/demo_prompt-BpZVtafc.gif",l="/learning-ai/assets/assistant-BJUR0Mbm.png",p="/learning-ai/assets/multi_plugin-TCdQZhy0.png",c="/learning-ai/assets/result_prompt-C4XLLbdh.png",h={};function d(u,e){return t(),i("div",null,e[0]||(e[0]=[n('
LibreChat is a free, open source AI chat platform. This Web UI offers vast customization, supporting numerous AI providers, services, and integrations. Serves all AI Conversations in one place with a familiar interface, innovative enhancements, for as many users as you need.
The full librechat documentation is available here
Let's discover how to use LibreChat to create efficient and effective conversations with AI for developers.
Prompts history allows users to save and load prompts for their conversations and easily access them later. Reusing prompts can save time and effort, especially when working with multiple conversations and keep track of the context and details of a conversation.
The presets feature allows users to save and load predefined settings for initialise a conversations. Users can import and export these presets as JSON files, set a default preset, and share them with others.
The prompts feature allows users to save and load predefined prompts to use it during their conversations. You can use a prompt with the /[prompt command]. A prompt can have parameters, which are replaced with values when the prompt is used.
Exemple of preformatted prompts : Explain the following code snippet in Java, Kotlin or Javascript
Click on the + button to add a new prompt.
name your prompt : explain
on Text tab, you can write your prompt :
Explain the following {{language:Java|Kotlin|Javascript}} snippet of code:
+{{code}}
+
Now you can use the /explain command to get the explanation of the code snippet.
Azure OpenAI Service provides REST API access to OpenAI's powerful language models, including the o1-preview, o1-mini, GPT-4o, GPT-4o mini, GPT-4 Turbo with Vision, GPT-4, GPT-3.5-Turbo, and Embeddings model series.
Gemini is a large language model (LLM) developed by Google. It's designed to be a multimodal AI, meaning it can work with and understand different types of information, including text, code, audio, and images. Google positions Gemini as a highly capable model for a range of tasks, from answering questions and generating creative content to problem-solving and more complex reasoning. There are different versions of Gemini, optimized for different tasks and scales.
Claude is an Artificial Intelligence, trained by Anthropic. Claude can process large amounts of information, brainstorm ideas, generate text and code, help you understand subjects, coach you through difficult situations, help simplify your busywork so you can focus on what matters most, and so much more.
The Assistants API enables the creation of AI assistants, offering functionalities like code interpreter, knowledge retrieval of files, and function execution. The Assistants API allows you to build AI assistants within your own applications for specific needs. An Assistant has instructions and can leverage models, tools, and files to respond to user queries. The Assistants API currently supports three types of tools: Code Interpreter, File Search, and Function calling.
The plugins endpoint opens the door to prompting LLMs in new ways other than traditional input/output prompting.
Warning
Every additional plugin selected will increase your token usage as there are detailed instructions the LLM needs for each one For best use, be selective with plugins per message and narrow your requests as much as possible
Dall-e 3 is a librechat Plugin for generating images from text. You can use it to generate images from text, such as product descriptions, product images, or even documentation images to illustrate your technical documentation.
Wolf is a librechat Plugin for WL Managagement System documents. The sharepoint documention is available here
Ask to WorldLine management system Friend everything you are looking for in the WMS content. AskWOLF plugin is meant to help you navigate through the multitude of information provided by the WMS (Applicable Policies, Processes & Procedures, Transversal & Operations SP pages links, …). This Worldline LibreChat plugin relies on ChatGPT technologies.
Worldline Management System (WMS) is the Group reference for all information pertaining to our operating model such as applicable policies, processes and governance structures. Key responsibilities are :
consistently address its customers’ and markets’ requirements across all its geographies
continuous improvement of customer satisfaction through effective application of WMS
correct interpretation of applicable ISO standards requirements
You can mix plugins to create more complex prompts. For example, you can use the DALL-E 3 plugin to generate images from text and then use the IT support plugin to get support from the IT team.
Generate the favicon 16x16 pixels based on the content found in
+https://worldline.github.io/learning-ai/overview/ with Browser plugin
+and generate the favicon with DallE. I want no background and black and white image
+
RAG is possible with LibreChat. You can use RAG to create a conversation with the AI. To can add files to the conversation, you go to the file tab and select the file you want to add. Then the file will be added to the file manager and you can use it in the prompt.
The file can be an png, a video, a text file, or a PDF file.
Choose your favorite topic ( cooking, travel, sports, etc.) and create an assistant that can answer questions about it. You can share documents, files and instructions to configure your custom assistant and use it.
',63)]))}const g=a(h,[["render",d],["__file","index.html.vue"]]),f=JSON.parse('{"path":"/llm/","title":"Online with Librechat","lang":"en-US","frontmatter":{"description":"Online with Librechat librechat_interface LibreChat is a free, open source AI chat platform. This Web UI offers vast customization, supporting numerous AI providers, services, a...","head":[["meta",{"property":"og:url","content":"https://worldline.github.io/worldline/learning-ai/learning-ai/llm/"}],["meta",{"property":"og:title","content":"Online with Librechat"}],["meta",{"property":"og:description","content":"Online with Librechat librechat_interface LibreChat is a free, open source AI chat platform. This Web UI offers vast customization, supporting numerous AI providers, services, a..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-11-20T13:15:23.000Z"}],["meta",{"property":"article:modified_time","content":"2024-11-20T13:15:23.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Online with Librechat\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-11-20T13:15:23.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Prompts history","slug":"prompts-history","link":"#prompts-history","children":[]},{"level":2,"title":"Favorites","slug":"favorites","link":"#favorites","children":[]},{"level":2,"title":"Presets","slug":"presets","link":"#presets","children":[]},{"level":2,"title":"Preformatted prompts","slug":"preformatted-prompts","link":"#preformatted-prompts","children":[]},{"level":2,"title":"AI providers","slug":"ai-providers","link":"#ai-providers","children":[{"level":3,"title":"Azure OpenAI","slug":"azure-openai","link":"#azure-openai","children":[]},{"level":3,"title":"Google Gemini","slug":"google-gemini","link":"#google-gemini","children":[]},{"level":3,"title":"Anthropic Claude","slug":"anthropic-claude","link":"#anthropic-claude","children":[]}]},{"level":2,"title":"Assistants","slug":"assistants","link":"#assistants","children":[]},{"level":2,"title":"Plugins","slug":"plugins","link":"#plugins","children":[{"level":3,"title":"DALL-E 3","slug":"dall-e-3","link":"#dall-e-3","children":[]},{"level":3,"title":"Confluence","slug":"confluence","link":"#confluence","children":[]},{"level":3,"title":"IT support","slug":"it-support","link":"#it-support","children":[]},{"level":3,"title":"WOLF","slug":"wolf","link":"#wolf","children":[]},{"level":3,"title":"Browse plugins","slug":"browse-plugins","link":"#browse-plugins","children":[]}]},{"level":2,"title":"Plugin mixing","slug":"plugin-mixing","link":"#plugin-mixing","children":[]},{"level":2,"title":"RAG","slug":"rag","link":"#rag","children":[]},{"level":2,"title":"🧪 Exercises","slug":"🧪-exercises","link":"#🧪-exercises","children":[]},{"level":2,"title":"📖 Further readings","slug":"📖-further-readings","link":"#📖-further-readings","children":[]}],"git":{"updatedTime":1732108523000,"contributors":[{"name":"Brah","email":"brah.gharbi@gmail.com","commits":2,"url":"https://github.com/Brah"}]},"filePathRelative":"llm/README.md","autoDesc":true}');export{g as comp,f as data};
diff --git a/assets/index.html-DC5R9WtP.js b/assets/index.html-DC5R9WtP.js
new file mode 100644
index 0000000..8f9bd03
--- /dev/null
+++ b/assets/index.html-DC5R9WtP.js
@@ -0,0 +1 @@
+import{_ as t,o as n,c as l,a,b as i}from"./app-DkfO46MA.js";const r="/learning-ai/assets/turing_test-DKoxXym2.png",o="/learning-ai/assets/gasparov-DChlTPYb.jpg",s="/learning-ai/assets/jeopardy-CySJ857r.jpg",c="/learning-ai/assets/alphago-D7ibr0g1.png",p="/learning-ai/assets/market-C_dAjFms.png",h="/learning-ai/assets/top50-Du4eFrfo.png",d={};function u(b,e){return n(),l("div",null,e[0]||(e[0]=[a('
The AI should include support for providing guidance on using shell commands, navigating file systems, and executing command-line operations across different operating systems.
Proficiency in HTTP protocol, RESTful API concepts, and web service integration is crucial for the AI to provide support on API design, consumption, and troubleshooting common API-related issues.
Understanding of cloud computing principles, including basic concepts of cloud infrastructure, services, and deployment models, will enable the AI to offer guidance on cloud-based development, deployment, and best practices.
Large Language Model is a powerful type of AI model trained on massive datasets of text and code. LLMs can understand, generate, and manipulate language. Ex : ChatGPT, Bard, Codex
What are Large Language Models (LLMs)? by Google for developpers
',14),i("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/iR2O2GPbB0E",title:"What are Large Language Models (LLMs)? by Google for developpers",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""},null,-1),a('
Multi-Modal Large Language Model is an advanced LLM that can process and generate both text and other data formats like images, audio, or video. Ex: DALL-E 2, Stable Diffusion (for image generation)
Machine Learning is a subset of AI that focuses on training algorithms to learn from data and make predictions or decisions without explicit programming. ML powers many AI applications, including image recognition, natural language processing, and predictive analytics.
Deep Learning is a type of ML that uses artificial neural networks with multiple layers to learn complex patterns from data.DL has revolutionized fields like computer vision, speech recognition, and machine translation.
A computational model inspired by the structure of the human brain, consisting of interconnected nodes (neurons) organized in layers.Neural networks are the core building blocks of deep learning models.
Natural Language Processing is a branch of Artificial Intelligence (AI) that focuses on enabling computers to understand, interpret, and generate human language. It implies :
Text Analysis
Language Understanding
Text Generation
Translation
Speech Recognition: Powers voice assistants and speech-to-text technologies
A specific set of instructions or questions given to an LLM to guide its response. Well-crafted prompts are crucial for getting accurate and relevant output from LLMs. Ex : "Write a Python function to check if a string is a palindrome."
The smallest unit of meaning processed by an LLM. Tokens can be words, parts of words, punctuation marks, or special characters. LLMs process text by analyzing sequences of tokens, making it important to understand how they are broken down. Ex : The sentence "I love programming" would be split into the following tokens: "I", "love", "programming".
A parameter in some LLMs that controls the randomness or creativity of the generated text. Adjust temperature based on the desired level of creativity or accuracy in the LLM's output.
A higher temperature generate more randomness and unpredictability in the output.
A lower temperature generate more predictable and coherent output.
RAG (Retrieval Augmented Generation) is a powerful technique in the field of Natural Language Processing (NLP) that combines the best of both worlds: information retrieval and language generation.
The system first retrieves relevant information from a vast knowledge base (often a database or a set of documents) based on the user's query or prompt.
This retrieved information is then used to augment the language model's input, providing it with more context and specific facts.
Finally, the language model uses this augmented input to generate a more comprehensive and informative response, leveraging both its knowledge base and its language generation capabilities.
AI's history has been marked by periods of progress and setbacks. Computing power, data availability, and algorithmic advancements have played crucial roles in AI's evolution. AI is no longer limited to expert systems but encompasses a wide range of techniques and applications.
1950: Alan Turing proposes the "Turing Test" to assess machine intelligence.
During the turing test, the human questioner asks a series of questions to both respondantes. After the specified time, the questionner tries to decide which terminal is operated bu the human respondant and which terminal is operated by the computer.
1956: Dartmouth Conference establishes the field of "Artificial Intelligence".
1959: Arthur Samuel develops a checkers-playing program that learns and improves over time.
1960s: Research focused on logic-based reasoning and early expert systems.
1972: The first expert system, DENDRAL, is developed for identifying organic molecules.
1980s-1990s: Development of new techniques like machine learning and neural networks.
1997: Deep Blue, a chess-playing computer, defeats Garry Kasparov, the world chess champion.
1990s-2000s: Advances in computing power, data availability, and algorithms as fuel for AI progress.
2010s: Deep learning revolutionizes AI with breakthroughs in image recognition, speech recognition, and natural language processing.
2011: Watson, an IBM supercomputer, wins Jeopardy! against human champions.
2016: AlphaGo, a program developed by Google DeepMind, defeats Go champion Lee Sedol.
2022: First release of ChatGPT : AI continues to evolve rapidly, with advancements in areas like autonomous vehicles, robotics, and personalized medicine.
',35)]))}const m=t(d,[["render",u],["__file","index.html.vue"]]),f=JSON.parse(`{"path":"/overview/","title":"Let's start","lang":"en-US","frontmatter":{"description":"Let's start Warning LLMs and MMLLMs are constantly evolving, and new applications for developer training are emerging all the time. Prerequisites Shell Command Line Skills: The ...","head":[["meta",{"property":"og:url","content":"https://worldline.github.io/worldline/learning-ai/learning-ai/overview/"}],["meta",{"property":"og:title","content":"Let's start"}],["meta",{"property":"og:description","content":"Let's start Warning LLMs and MMLLMs are constantly evolving, and new applications for developer training are emerging all the time. Prerequisites Shell Command Line Skills: The ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-11-20T13:15:23.000Z"}],["meta",{"property":"article:modified_time","content":"2024-11-20T13:15:23.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Let's start\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-11-20T13:15:23.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Prerequisites","slug":"prerequisites","link":"#prerequisites","children":[]},{"level":2,"title":"Definitions","slug":"definitions","link":"#definitions","children":[{"level":3,"title":"Large Language Model (LLM)","slug":"large-language-model-llm","link":"#large-language-model-llm","children":[]},{"level":3,"title":"Multi-Modal LLM (MMLLM)","slug":"multi-modal-llm-mmllm","link":"#multi-modal-llm-mmllm","children":[]},{"level":3,"title":"Machine Learning (ML)","slug":"machine-learning-ml","link":"#machine-learning-ml","children":[]},{"level":3,"title":"Deep Learning (DL)","slug":"deep-learning-dl","link":"#deep-learning-dl","children":[]},{"level":3,"title":"Neural Network","slug":"neural-network","link":"#neural-network","children":[]}]},{"level":2,"title":"A bit of History","slug":"a-bit-of-history","link":"#a-bit-of-history","children":[]},{"level":2,"title":"The market","slug":"the-market","link":"#the-market","children":[]},{"level":2,"title":"🧪 Exercises","slug":"🧪-exercises","link":"#🧪-exercises","children":[]},{"level":2,"title":"📖 Further readings","slug":"📖-further-readings","link":"#📖-further-readings","children":[]}],"git":{"updatedTime":1732108523000,"contributors":[{"name":"Brah","email":"brah.gharbi@gmail.com","commits":3,"url":"https://github.com/Brah"},{"name":"Ibrahim Gharbi","email":"brah.gharbi@gmail.com","commits":4,"url":"https://github.com/Ibrahim Gharbi"}]},"filePathRelative":"overview/README.md","autoDesc":true}`);export{m as comp,f as data};
diff --git a/assets/index.html-bbNjYxoL.js b/assets/index.html-bbNjYxoL.js
new file mode 100644
index 0000000..dc03679
--- /dev/null
+++ b/assets/index.html-bbNjYxoL.js
@@ -0,0 +1,12 @@
+import{_ as n,o as s,c as a,a as t}from"./app-DkfO46MA.js";const o="/learning-ai/assets/lmstudio-B6PjFtYg.png",i={};function l(p,e){return s(),a("div",null,e[0]||(e[0]=[t('
Be careful with offline prompting models downloaded from the internet. They can contain malicious code. And also the size of the model can be very large from few Gb to few Tb.
If you don't want to use the online AI providers, you can use offline prompting. This technique involves using a local LLM to generate responses to prompts. It is useful for developers who want to use a local LLM for offline prompting or for those who want to experiment with different LLMs without relying on online providers.
LM Studio is a tool that allows developers to experiment with different LLMs without relying on online providers. It provides a user-friendly interface for selecting and configuring LLMs, as well as a chat interface for interacting with the LLMs. It also includes features for fine-tuning and deploying LLMs. This technique is useful for developers who want to experiment with different LLMs.
You can configure the model you want to use in the settings tab. You can select the model you want to use and configure it according to your needs.
Context Length: The context length is the number of tokens that will be used as context for the model. This is important because it determines how much information the model can use to generate a response. A longer context length will allow the model to generate more detailed and relevant responses, but it may also increase the computational cost of the model.
GPU Offload: This option allows you to offload the model to a GPU if available. This can significantly speed up the generation process, especially for longer prompts or complex models.
CPU Threads: This option allows you to specify the number of CPU threads to use for the model. This can be useful for controlling the computational resources used by the model.
Evaluation batch size: This option allows you to specify the batch size for evaluation. This is important for evaluating the performance of the model and can affect the speed and accuracy of the generation process.
RoPE Frequency base: This option allows you to specify the frequency base for RoPE (Range-based Output Embedding). This is important for controlling the output length of the model and can affect the quality of the generated responses.
RoPE Frequency scale: This option allows you to specify the frequency scale for RoPE (Range-based Output Embedding). This is important for controlling the output length of the model and can affect the quality of the generated responses.
Keep model in memory: This option allows you to keep the model in memory after the generation process is complete. This can be useful for generating multiple responses or for using the model for offline prompting.
Try mmap() for faster loading: This option allows you to try using mmap() for faster loading of the model. This can be useful for loading large models or for generating responses quickly.
Seed: This option allows you to specify a seed for the model. This can be useful for controlling the randomness of the generated responses.
Flash Attention: This option allows you to enable flash attention for the model. This can be useful for generating more detailed and accurate responses, but it may also increase the computational cost of the model.
You can use the APIs to generate responses from the models. To enable the API server with LM Studio, you need to set the API Server option to ON in the settings tab. You can then use the API endpoints to generate responses from the models.
2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Success! HTTP server listening on port 1234
+2024-11-15 18:45:22 [INFO]
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Supported endpoints:
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> GET http://localhost:1234/v1/models
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/chat/completions
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/completions
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/embeddings
+2024-11-15 18:45:22 [INFO]
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Logs are saved into /Users/ibrahim/.cache/lm-studio/server-logs
+2024-11-15 18:45:22 [INFO] Server started.
+2024-11-15 18:45:22 [INFO] Just-in-time model loading active.
+
You can use the endpoints to generate responses from the models. The endpoints are as follows:
GET /v1/models: This endpoint returns a list of the available models.
POST /v1/chat/completions: This endpoint generates responses from the models using the chat format.Chat format is used for tasks such as chatbots, conversational AI, and language learning.
POST /v1/completions: This endpoint generates responses from the models using the completion format. Completion format is used for tasks such as question answering, summarization, and text generation.
POST /v1/embeddings: This endpoint generates embeddings from the models. Embeddings are used for tasks such as sentiment analysis, text classification, and language translation.
GitHub Spark is an AI-powered tool for creating and sharing micro apps (“sparks”), which can be tailored to your exact needs and preferences, and are directly usable from your desktop and mobile devices. Without needing to write or deploy any code.
And it enables this through a combination of three tightly-integrated components:
An NL-based editor, which allows easily describing your ideas, and then refining them over time A managed runtime environment, which hosts your sparks, and provides them access to data storage, theming, and LLMs A PWA-enabled dashboard, which lets you manage and launch your sparks from anywhere
We design payments technology that powers the growth of millions of businesses around the world. Engineering the next frontiers in payments technology
LibreChat is a free, open source AI chat platform. This Web UI offers vast customization, supporting numerous AI providers, services, and integrations. Serves all AI Conversations in one place with a familiar interface, innovative enhancements, for as many users as you need.
The full librechat documentation is available here
Let's discover how to use LibreChat to create efficient and effective conversations with AI for developers.
Prompts history allows users to save and load prompts for their conversations and easily access them later. Reusing prompts can save time and effort, especially when working with multiple conversations and keep track of the context and details of a conversation.
The presets feature allows users to save and load predefined settings for initialise a conversations. Users can import and export these presets as JSON files, set a default preset, and share them with others.
The prompts feature allows users to save and load predefined prompts to use it during their conversations. You can use a prompt with the /[prompt command]. A prompt can have parameters, which are replaced with values when the prompt is used.
Exemple of preformatted prompts : Explain the following code snippet in Java, Kotlin or Javascript
Click on the + button to add a new prompt.
name your prompt : explain
on Text tab, you can write your prompt :
Explain the following {{language:Java|Kotlin|Javascript}} snippet of code:
+{{code}}
+
Now you can use the /explain command to get the explanation of the code snippet.
Azure OpenAI Service provides REST API access to OpenAI's powerful language models, including the o1-preview, o1-mini, GPT-4o, GPT-4o mini, GPT-4 Turbo with Vision, GPT-4, GPT-3.5-Turbo, and Embeddings model series.
Gemini is a large language model (LLM) developed by Google. It's designed to be a multimodal AI, meaning it can work with and understand different types of information, including text, code, audio, and images. Google positions Gemini as a highly capable model for a range of tasks, from answering questions and generating creative content to problem-solving and more complex reasoning. There are different versions of Gemini, optimized for different tasks and scales.
Claude is an Artificial Intelligence, trained by Anthropic. Claude can process large amounts of information, brainstorm ideas, generate text and code, help you understand subjects, coach you through difficult situations, help simplify your busywork so you can focus on what matters most, and so much more.
The Assistants API enables the creation of AI assistants, offering functionalities like code interpreter, knowledge retrieval of files, and function execution. The Assistants API allows you to build AI assistants within your own applications for specific needs. An Assistant has instructions and can leverage models, tools, and files to respond to user queries. The Assistants API currently supports three types of tools: Code Interpreter, File Search, and Function calling.
The plugins endpoint opens the door to prompting LLMs in new ways other than traditional input/output prompting.
Warning
Every additional plugin selected will increase your token usage as there are detailed instructions the LLM needs for each one For best use, be selective with plugins per message and narrow your requests as much as possible
Dall-e 3 is a librechat Plugin for generating images from text. You can use it to generate images from text, such as product descriptions, product images, or even documentation images to illustrate your technical documentation.
Wolf is a librechat Plugin for WL Managagement System documents. The sharepoint documention is available here
Ask to WorldLine management system Friend everything you are looking for in the WMS content. AskWOLF plugin is meant to help you navigate through the multitude of information provided by the WMS (Applicable Policies, Processes & Procedures, Transversal & Operations SP pages links, …). This Worldline LibreChat plugin relies on ChatGPT technologies.
Worldline Management System (WMS) is the Group reference for all information pertaining to our operating model such as applicable policies, processes and governance structures. Key responsibilities are :
consistently address its customers’ and markets’ requirements across all its geographies
continuous improvement of customer satisfaction through effective application of WMS
correct interpretation of applicable ISO standards requirements
You can mix plugins to create more complex prompts. For example, you can use the DALL-E 3 plugin to generate images from text and then use the IT support plugin to get support from the IT team.
Generate the favicon 16x16 pixels based on the content found in
+https://worldline.github.io/learning-ai/overview/ with Browser plugin
+and generate the favicon with DallE. I want no background and black and white image
+
RAG is possible with LibreChat. You can use RAG to create a conversation with the AI. To can add files to the conversation, you go to the file tab and select the file you want to add. Then the file will be added to the file manager and you can use it in the prompt.
The file can be an png, a video, a text file, or a PDF file.
Choose your favorite topic ( cooking, travel, sports, etc.) and create an assistant that can answer questions about it. You can share documents, files and instructions to configure your custom assistant and use it.
Be careful with offline prompting models downloaded from the internet. They can contain malicious code. And also the size of the model can be very large from few Gb to few Tb.
If you don't want to use the online AI providers, you can use offline prompting. This technique involves using a local LLM to generate responses to prompts. It is useful for developers who want to use a local LLM for offline prompting or for those who want to experiment with different LLMs without relying on online providers.
LM Studio is a tool that allows developers to experiment with different LLMs without relying on online providers. It provides a user-friendly interface for selecting and configuring LLMs, as well as a chat interface for interacting with the LLMs. It also includes features for fine-tuning and deploying LLMs. This technique is useful for developers who want to experiment with different LLMs.
You can configure the model you want to use in the settings tab. You can select the model you want to use and configure it according to your needs.
Context Length: The context length is the number of tokens that will be used as context for the model. This is important because it determines how much information the model can use to generate a response. A longer context length will allow the model to generate more detailed and relevant responses, but it may also increase the computational cost of the model.
GPU Offload: This option allows you to offload the model to a GPU if available. This can significantly speed up the generation process, especially for longer prompts or complex models.
CPU Threads: This option allows you to specify the number of CPU threads to use for the model. This can be useful for controlling the computational resources used by the model.
Evaluation batch size: This option allows you to specify the batch size for evaluation. This is important for evaluating the performance of the model and can affect the speed and accuracy of the generation process.
RoPE Frequency base: This option allows you to specify the frequency base for RoPE (Range-based Output Embedding). This is important for controlling the output length of the model and can affect the quality of the generated responses.
RoPE Frequency scale: This option allows you to specify the frequency scale for RoPE (Range-based Output Embedding). This is important for controlling the output length of the model and can affect the quality of the generated responses.
Keep model in memory: This option allows you to keep the model in memory after the generation process is complete. This can be useful for generating multiple responses or for using the model for offline prompting.
Try mmap() for faster loading: This option allows you to try using mmap() for faster loading of the model. This can be useful for loading large models or for generating responses quickly.
Seed: This option allows you to specify a seed for the model. This can be useful for controlling the randomness of the generated responses.
Flash Attention: This option allows you to enable flash attention for the model. This can be useful for generating more detailed and accurate responses, but it may also increase the computational cost of the model.
You can use the APIs to generate responses from the models. To enable the API server with LM Studio, you need to set the API Server option to ON in the settings tab. You can then use the API endpoints to generate responses from the models.
2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Success! HTTP server listening on port 1234
+2024-11-15 18:45:22 [INFO]
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Supported endpoints:
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> GET http://localhost:1234/v1/models
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/chat/completions
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/completions
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] -> POST http://localhost:1234/v1/embeddings
+2024-11-15 18:45:22 [INFO]
+2024-11-15 18:45:22 [INFO][LM STUDIO SERVER] Logs are saved into /Users/ibrahim/.cache/lm-studio/server-logs
+2024-11-15 18:45:22 [INFO] Server started.
+2024-11-15 18:45:22 [INFO] Just-in-time model loading active.
+
You can use the endpoints to generate responses from the models. The endpoints are as follows:
GET /v1/models: This endpoint returns a list of the available models.
POST /v1/chat/completions: This endpoint generates responses from the models using the chat format.Chat format is used for tasks such as chatbots, conversational AI, and language learning.
POST /v1/completions: This endpoint generates responses from the models using the completion format. Completion format is used for tasks such as question answering, summarization, and text generation.
POST /v1/embeddings: This endpoint generates embeddings from the models. Embeddings are used for tasks such as sentiment analysis, text classification, and language translation.
The AI should include support for providing guidance on using shell commands, navigating file systems, and executing command-line operations across different operating systems.
Proficiency in HTTP protocol, RESTful API concepts, and web service integration is crucial for the AI to provide support on API design, consumption, and troubleshooting common API-related issues.
Understanding of cloud computing principles, including basic concepts of cloud infrastructure, services, and deployment models, will enable the AI to offer guidance on cloud-based development, deployment, and best practices.
Large Language Model is a powerful type of AI model trained on massive datasets of text and code. LLMs can understand, generate, and manipulate language. Ex : ChatGPT, Bard, Codex
What are Large Language Models (LLMs)? by Google for developpers
Multi-Modal Large Language Model is an advanced LLM that can process and generate both text and other data formats like images, audio, or video. Ex: DALL-E 2, Stable Diffusion (for image generation)
Machine Learning is a subset of AI that focuses on training algorithms to learn from data and make predictions or decisions without explicit programming. ML powers many AI applications, including image recognition, natural language processing, and predictive analytics.
Deep Learning is a type of ML that uses artificial neural networks with multiple layers to learn complex patterns from data.DL has revolutionized fields like computer vision, speech recognition, and machine translation.
A computational model inspired by the structure of the human brain, consisting of interconnected nodes (neurons) organized in layers.Neural networks are the core building blocks of deep learning models.
Natural Language Processing is a branch of Artificial Intelligence (AI) that focuses on enabling computers to understand, interpret, and generate human language. It implies :
Text Analysis
Language Understanding
Text Generation
Translation
Speech Recognition: Powers voice assistants and speech-to-text technologies
A specific set of instructions or questions given to an LLM to guide its response. Well-crafted prompts are crucial for getting accurate and relevant output from LLMs. Ex : "Write a Python function to check if a string is a palindrome."
The smallest unit of meaning processed by an LLM. Tokens can be words, parts of words, punctuation marks, or special characters. LLMs process text by analyzing sequences of tokens, making it important to understand how they are broken down. Ex : The sentence "I love programming" would be split into the following tokens: "I", "love", "programming".
A parameter in some LLMs that controls the randomness or creativity of the generated text. Adjust temperature based on the desired level of creativity or accuracy in the LLM's output.
A higher temperature generate more randomness and unpredictability in the output.
A lower temperature generate more predictable and coherent output.
RAG (Retrieval Augmented Generation) is a powerful technique in the field of Natural Language Processing (NLP) that combines the best of both worlds: information retrieval and language generation.
The system first retrieves relevant information from a vast knowledge base (often a database or a set of documents) based on the user's query or prompt.
This retrieved information is then used to augment the language model's input, providing it with more context and specific facts.
Finally, the language model uses this augmented input to generate a more comprehensive and informative response, leveraging both its knowledge base and its language generation capabilities.
AI's history has been marked by periods of progress and setbacks. Computing power, data availability, and algorithmic advancements have played crucial roles in AI's evolution. AI is no longer limited to expert systems but encompasses a wide range of techniques and applications.
1950: Alan Turing proposes the "Turing Test" to assess machine intelligence.
During the turing test, the human questioner asks a series of questions to both respondantes. After the specified time, the questionner tries to decide which terminal is operated bu the human respondant and which terminal is operated by the computer.
1956: Dartmouth Conference establishes the field of "Artificial Intelligence".
1959: Arthur Samuel develops a checkers-playing program that learns and improves over time.
1960s: Research focused on logic-based reasoning and early expert systems.
1972: The first expert system, DENDRAL, is developed for identifying organic molecules.
1980s-1990s: Development of new techniques like machine learning and neural networks.
1997: Deep Blue, a chess-playing computer, defeats Garry Kasparov, the world chess champion.
1990s-2000s: Advances in computing power, data availability, and algorithms as fuel for AI progress.
2010s: Deep learning revolutionizes AI with breakthroughs in image recognition, speech recognition, and natural language processing.
2011: Watson, an IBM supercomputer, wins Jeopardy! against human champions.
2016: AlphaGo, a program developed by Google DeepMind, defeats Go champion Lee Sedol.
2022: First release of ChatGPT : AI continues to evolve rapidly, with advancements in areas like autonomous vehicles, robotics, and personalized medicine.
For basic APIs exchange with LibreChat, you can use simple HTTP requests. You can use the /api/v1/chat/completions endpoint to send a request to the API and receive a response.
GCP is a suite of cloud computing services provided by Google. It includes a wide range of tools and services for building and consuming LLMs, such as Vertex AI, Google Colab, and ML Flow.
These products are directly available to consumers, often integrating AI capabilities into everyday applications:
Google Colaboratory (Colab): A free Jupyter Notebook environment hosted by Google. Excellent for learning, experimentation, and sharing machine learning code. While not a "production" platform like Vertex AI, it's extremely popular for its ease of use and free access to compute resources (though with limitations).
Gemini: Google's large language model (LLM), positioned as a competitor to OpenAI's GPT models. Gemini's capabilities are integrated into various Google products and services, and are also accessible through APIs. Different versions of Gemini (e.g., Gemini Pro, Gemini Ultra) offer varying levels of capability and access. It powers several consumer-facing features across Google's ecosystem.
AI Studio Cloud-based machine learning platform offered by several companies, most notably Google with its Google AI Studio (now largely integrated into Vertex AI) and Amazon with Amazon SageMaker Studio. While both share the general goal of providing a user-friendly environment for building, training, and deploying machine learning models, their specific features and offerings differ. https://aistudio.google.com/
This is the central hub for most Google Cloud's AI/ML services. It integrates and supersedes many previous offerings.
Vertex AI Training: Training machine learning models using various algorithms and frameworks (TensorFlow, PyTorch, scikit-learn, XGBoost, etc.). Provides access to managed compute instances (including TPUs).
Vertex AI Prediction: Deploying trained models for inference (making predictions). Offers different deployment options based on scale and latency requirements.
Vertex AI Pipelines: Creating and managing machine learning workflows, including data preprocessing, model training, evaluation, and deployment, as a series of connected steps.
Vertex AI Model Monitoring: Monitoring deployed models for performance degradation and potential issues (drift).
Vertex AI Feature Store: Centralized repository for storing, managing, and versioning features used in machine learning models, improving collaboration and reuse.
Vertex AI Matching Engine: A service for performing similarity searches (for example, recommendation systems).
Pre-trained Models and APIs: Google offers numerous pre-trained models and APIs for various tasks, making it easier to integrate AI into applications without building models from scratch. Examples include:
Google Cloud Natural Language API: Processing and understanding text (sentiment analysis, entity recognition, etc.). Google Cloud Vision API: Analyzing images (object detection, image classification, optical character recognition, etc.).
Google Cloud Speech-to-Text API: Converting audio to text.
Google Cloud Text-to-Speech API: Converting text to audio.
Google Cloud Translation API: Translating text between languages.
Other APIs: Many more APIs exist for various tasks like video intelligence, dialogflow (conversational AI), and more.
Beyond the core platform and APIs, Google offers several specialized AI products:
TensorFlow: A popular open-source machine learning framework developed by Google. While not strictly a "Google Cloud" product, it's deeply integrated with their services.
TensorFlow Extended (TFX): A platform for deploying TensorFlow models at scale, often used in conjunction with Vertex AI.
JAX: A high-performance machine learning library, often used for research and advanced applications.
Google AI Platform Notebooks (integrated into Vertex AI): Jupyter Notebook environments hosted on Google Cloud. (Previously a separate offering, often confused with Google Colab.)
Dialogflow CX: A conversational AI platform for building complex conversational experiences.
MLflow provides tools for managing experiments, tracking model versions, deploying models to various environments, and managing models in a central registry. It's designed to be platform-agnostic, meaning it can work with many different cloud providers and even on-premises infrastructure.
Function calling is a feature that allows you to call functions from other services. It is useful for working with functions, such as APIs, and for interacting with models that require function calls.
To use function calling, you need to specify the function name and arguments in the prompt.
Json mode is a feature that allows you to send structured data to the model. It is useful for working with structured data, such as JSON objects, and for interacting with models that require structured input.
To use Json mode, you need to specify the input format as JSON in the prompt. You can do this by adding the following line to the beginning of your prompt:
The platform where the machine learning community collaborates on models, datasets, and applications.
Hugging Face is a platform for researchers and developers to share, explore, and build AI models. It provides a centralized repository for models, datasets, and applications, making it easy to find, use, and contribute to the growing ecosystem of AI technologies.
Creating/deploy/customize a model
Pre-trained model, use behind the APIs, also a ML part, training model generation for use
Prompt engineering involves the design and creation of prompts that are used to elicit specific responses or actions from AI models or interactive systems. These prompts are carefully crafted to guide the behavior or generate particular outputs from the AI, such as generating natural language responses, providing recommendations, or completing specific tasks.
In the context of AI language models, prompt engineering is especially important for shaping the model's behavior and output. By designing prompts effectively, engineers can influence the model's responses and ensure that it generates coherent, relevant, and accurate content.
There are four main areas to consider when writing an effective prompt. You don’t need to use all four, but using a few will help!
Persona: Who is the user you're writing for? What are their skills and knowledge?
Task: What specific action do you want the user to perform?
Context: What information does the user need to know to complete the task?
Format: What is the desired output of the task?
Example Prompt:
[Persona] You are a Google Cloud program manager.
[Task] Draft an executive summary email
[Context] to [person description] based on [details about relevant program docs].
[Format] Limit to bullet points.
By using "act as," you are establishing a specific context for the language model and guiding it to understand the type of task or request you are making. This helps to set the right expectations and provides the language model with the necessary context to generate a response tailored to the defined role.
"Act as a creative writing assistant and generate a short story based
+on a prompt about a futuristic world where robots have become sentient."
+
Summary is a prompt engineering technique that involves providing a summary of a given document or text. It can helps for summarizing changelogs, articles, or other technical documents.
Help me write an article of this document [Insert or copy paste document text]
+Generate 5 titles out of the following topic….
+Generate a subtitle to catch readers’ attention on the following
+topic [describe the topic]
+
Write is a prompt engineering technique that involves providing a step-by-step guide or instructions for a given task or process. Its useful for developers to create functional and technical documentations.
Create a template of an email response to customer inquiring about ….
+Create a guide that explains how to use ….
+Write step by step instructions
+
Code explanation is a prompt engineering technique that involves providing a detailed explanation of a code snippet or function. This technique is useful for developers who want to understand the inner workings of a codebase or for those who want to document their code.
cf. Preformatted prompts for an example of code explanation
Code completion is a prompt engineering technique that involves providing a list of possible completions for a given code snippet or function. This technique is useful for developers who want to suggest possible code changes or improvements based on their existing code.
Code conversion is a prompt engineering technique that involves providing a conversion of a code snippet or function from one programming language to another. This technique is useful for developers who want to migrate their code from one language to another or for those who want to use a different programming language for their projects.
Code review is a prompt engineering technique that involves providing a code review of a given code snippet or function. This technique is useful for developers who want to review their code for potential issues,bugs, or for those who want to provide feedback on their code.
Code fixing is a prompt engineering technique that involves providing a code fix for a given code snippet or function. This technique is useful for developers who want to fix bugs or issues in their code or for those who want to improve the quality of their code.
Help me find mistakes in my code [insert your code]
+Explain what this snippet of code does [insert code snippet]
+What it the correct syntax for a [statement or function]
+in [programming language]
+How do I fix the following programming language code
+[program language] code which explain the functioning [Insert code snippet]
+
Code refactor is a prompt engineering technique that involves providing a code refactoring of a given code snippet or function within a specific scope. This technique is useful for developers who want to refactor their code within a specific context or for those who want to improve the readability and maintainability of their code.
Mock data generation is a prompt engineering technique that involves providing a mock data set for a given code snippet or function. This technique is useful for developers who want to test their code with mock data or for those who want to generate test data for their projects. It avoid creating manually fake data for testing.
Testing is a prompt engineering technique that involves providing a test case for a given code snippet or function. This technique is useful for developers who want to test their code or for those who want to ensure the correctness of their code.
System design and architecture is a prompt engineering technique that involves providing a system design or architecture for a given code snippet or function. This technique is useful for developers who want to design their code or for those who want to understand the overall architecture of their projects.
Documentation generation is a prompt engineering technique that involves providing a documentation for a given code snippet or function. This technique is useful for developers who want to document their code or for those who want to provide documentation for their projects. It can be used to generate documentation in various formats such as Markdown, HTML, or PDF.
Commit message generation is a prompt engineering technique that involves providing a commit message for a given code snippet or function. This technique is useful for developers who want to generate commit messages for their code or for those who want to ensure that their commit messages are clear and concise.
Vulnerability checking is a prompt engineering technique that involves providing a vulnerability check for a given code snippet or function. This technique is useful for developers who want to check for vulnerabilities in their code or for those who want to ensure that their code is secure.
Warning
This prompt is not recommended for production use. It is intended for testing and debugging purposes only and is not a proof of security or safety of your app.
You can understand complex regular expressions and generate ones that match specific patterns in text. This technique is useful for developers who want to write complex regular expressions or for those who want to understand the syntax of regular expressions.
Explain this regular expression in JavaScript: const regex =
+/^[A-Za-z0–9._%+-]+@[A-Za-z0–9.-]+\\.[A-Za-z]{2,}$/;
+
Create a function that calculates the factorial of a number.
Handle both positive integers and zero, with error handling for negative inputs.
Expected Output (python)
deffactorial(n):
+if n <0:
+raise ValueError("Input must be a non-negative integer.")
+if n ==0:
+return1
+ result =1
+for i inrange(1, n +1):
+ result *= i
+return result
+
Create prompts that can generate mock user profiles. The language used is JavaScript.
The profile should include:
Name
Age
Email
Address (Street, City, State, Zip Code)
Phone Number
Solutions
Exercise 1: Basic Function Creation
Persona: Python Developer Task: Create a function Context: You need to calculate the factorial of a number.
As a Python Developer, create a function named factorial that takes a single integer input and returns its factorial. The function should handle both positive integers and zero. Include error handling for negative inputs.
Exercise 2: API Request Handling
Persona: JavaScript Developer Task: Write a function to handle API requests Context: You need to fetch data from a given URL.
As a JavaScript Developer, write a function named fetchData that takes a URL as an argument and fetches data from that URL using the Fetch API. The function should return the JSON response and handle any errors that may occur during the fetch operation.
Exercise 3: Class Definition
Persona: C# Developer Task: Define a class Context: You are creating a representation of a book.
As a C# Developer, create a class named Book that has properties for Title, Author, and PublicationYear. Include a method named DisplayDetails that prints the book's details in a formatted string.
Exercise 4: Simple Web Server
Persona: JavaScript Developer Task: Set up a web server Context: You need to create a simple server that responds to requests.
As a JavaScript Developer, set up a simple web server using the http module that listens on port 3000 and responds with "Hello, World!" when accessed.
Exercise 5: Data Validation
Persona: Ruby Developer Task: Write a validation method Context: You need to validate email addresses.
As a Ruby Developer, write a method named valid_email? that takes a string as input and returns true if it is a valid email address, and false otherwise. Use a regular expression for validation.
Exercise 6: Mock Data Generation
As a JavaScript Developer, write a function named generateUserProfile that generates a mock user profile with the following details: name, age, email, address, and phone number. The function should return an object containing the user profile details.