Enter a new era of productivity with generative AI solutions for your business. Leverage AI, embedded as you need it, across the full stack.
Discover how to convert documents into actionable insights using OCI Generative AI, OpenSearch, and RAG in our interactive demo.
Learn how to run distributed multinode training with NVIDIA GPUs on OCI for efficient deep neural network training.
Improve insights to make smarter decisions by tapping into real-time data with Retrieval-Augmented Generation (RAG).
In the fast-paced world of software development, staying informed is crucial. Imagine having an AI assistant that can help quickly transform a complex webpage into content that’s bite-sized, easily consumable, and shareable. This is one of many things that Oracle Cloud Infrastructure (OCI) Generative AI can help you do.
Below is an example of how you can build such an AI assistant with OCI Generative AI.
The AI-powered GitHub trending projects summarizer is a personal content generation engine that automatically retrieves and summarizes the top 25 trending GitHub projects. OCI Generative AI helps extract, read, and compile each project’s README file into a concise, engaging, and informative summary that can be shared with others.
Try it out, with detailed steps and sample code on GitHub.
You can easily switch between multiple LLMs offered through OCI Generative AI simply by modifying the model_id
variable in summarize_llm.py
.
The above is a subset of available models. We’re constantly making newer models available.
Below is a code snippet to call OCI Generative AI:
content.text = """Generate an abstractive summary of the given Markdown contents. Here are the contents to summarize: {}""".format(summary_txt)
chat_detail.content = content.text
chat_detail.serving_mode = oci.generative_ai_inference.models.OnDemandServingMode(model_id="meta.llama-3.1-405b-instruct") # configurable model chat_response = generative_ai_inference_client.chat(chat_detail)
Retrieval-augmented generation (RAG) is one of the most important use cases for AI. RAG lets you augment the knowledge of an LLM without retraining it. It’s a way for the LLM to extract new information, from a database or elsewhere, and quickly present it to the end user.
This allows the LLM to acquire up-to-date knowledge regardless of when the LLM was trained and when inference was run. As a result, the updated data can make your LLM more intelligent with little to no effort.
After uploading documents to Oracle Cloud Infrastructure (OCI) GenAI Agents, the service will process the data and provide a way to consume it through a chatbot.
Try it out, with detailed steps and sample code on GitHub.
Below is a code snippet for using the RAG agent in OCI:
# ask a question to RAG agent question = "What steps do I take if I have a new patient under the patient admission recommendations?" # Initialize service client with default config file agent_runtime_client = GenerativeAiAgentRuntimeClient(config)
chat_response = agent_runtime_client.chat( agent_endpoint_id="ocid1.test.oc1..<id>", chat_details=ChatDetails(user_message=question))
# Get the data from response print(chat_response.data)
Oracle Database 23ai supports all modern data types and workloads, including vectors, and incorporates AI and machine learning capabilities directly within the database. By generating and storing vector embeddings for the data in question, developers can enable searches for semantic similarities using mathematical calculations. This technology allows for combining similarity searches with searches on business data using simple SQL, so anyone with a basic understanding of SQL can tap into its power.
By running Oracle APEX (a low-code application platform) on top of Oracle Database 23ai, the Oracle AI Vector Search capabilities are natively available at no additional cost. APEX developers can seamlessly include these advanced search functionalities in their applications, creating more accurate and context-aware results.
This scenario will implement a semantic search in Oracle APEX using AI Vector Search in Oracle Database 23ai.
Read the blog post about the scenario.
Below is code to convert image descriptions into vectors and store them in the database:
UPDATE SM_POSTS
SET
AI_IMAGE_VECTOR = TO_VECTOR(VECTOR_EMBEDDING ( DOC_MODEL
USING AI_IMAGE_DESCRIPTION AS DATA
));
Now that we have vectors, we can use them to perform semantic searches. In this demo, we can do that in the source query of the Cards Region:
SELECT A.*, TO_CHAR(ROUND(VECTOR_DISTANCE,2), '0.99')AS VECTOR_DISTANCE_DISPLAY FROM
(SELECT
p.id,
p.user_name,
p.comment_text,
p.file_blob,
p.file_mime,
p.post_date,
p.REACTIONS,
p.USER_REACTION_CSS,
p.CREATED,
(
CASE
WHEN :P1_SEARCH IS NOT NULL AND :P1_VECTOR_SEARCH = 'Y'
THEN VECTOR_DISTANCE (
TO_VECTOR(VECTOR_EMBEDDING (doc_model USING :P1_SEARCH AS data)),
ai_image_vector
)
ELSE NULL
END
) AS vector_distance,
ai_image_description
FROM
mv_SM_POSTS p
WHERE
(:P1_VECTOR_SEARCH <> 'Y' AND :P1_SEARCH IS NOT NULL AND UPPER(ai_image_description) LIKE UPPER('%'||:P1_SEARCH||'%'))
OR :P1_VECTOR_SEARCH = 'Y'
OR :P1_SEARCH IS NULL
ORDER BY
vector_distance ASC, p.CREATED asc) A
Oracle Database 23ai with AI Vector Search, combined with Oracle APEX, enables developers to rapidly build context-aware apps with improved search capability.
Generative AI can be especially good at helping to summarize sentiment, as this scenario shows. An ecommerce site may have hundreds of stock-keeping units, or SKUs, with dozens of reviews for each one. To help quickly summarize product reviews, developers can tap into HeatWave GenAI’s integrated capabilities, using in-database large language models and an automated, in-database vector store.
HeatWave GenAI can also help translate and analyze sentiment on demand. All operations can be automated with HeatWave GenAI, keeping summaries up-to-date as new reviews are added.
By keeping the data and processing within HeatWave, developers can scale solutions with their GenAI needs, making AI as simple as a database query.
Try it out, with detailed steps and sample code on GitHub.
Below is a code snippet illustrating how to summarize positive reviews:
SELECT "################### Computing summaries for EXISTING reviews on a product ###################" AS "";
SELECT "" AS "";
CALL SUMMARIZE_TRANSLATE(1, "POSITIVE", "en", @positive_english_summary);
SELECT @positive_english_summary AS "--- English summary of positive reviews on the T-Shirt ---";
Open source LLMs, such as those created by Hugging Face, are powerful tools that let developers try out GenAI solutions relatively quickly. Kubernetes, combined with Oracle Cloud Infrastructure (OCI), enables GenAI solutions to scale, while also providing flexibility, portability and resilience.
In this demo, you’ll see how easy it can be to deploy fine-tuned LLM inference containers on OCI Kubernetes Engine, a managed Kubernetes service that simplifies deployments and operations at scale for enterprises. The service enables developers to retain the custom model and data sets within their own tenancy without relying on a third-party inference API.
We’ll use Text Generation Inference as the inference framework to expose the LLMs.
Try it out, with detailed steps and sample code on GitHub.
Below is a code snippet illustrating how to deploy an open source LLM:
# select model from HuggingFace
model=HuggingFaceH4/zephyr-7b-beta
# deploy selected model
docker run ghcr.io/huggingface/text-generation-inference:2.0 --model-id $model
# invoke the deployed model
curl IP_address:port/generate_stream \
-X POST \
-d '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":50}}' \
-H 'Content-Type: application/json'
Oracle Code Assist is an AI code companion designed to help boost developer velocity and enhance code consistency. Powered by large language models (LLMs) on Oracle Cloud Infrastructure (OCI) and fine-tuned and optimized for Java, SQL, and application development on OCI, Oracle Code Assist provides developers with context-specific suggestions. You can tailor it to your organization’s best practices and codebases.
Currently available in beta for JetBrains IntelliJ IDEA and Microsoft Visual Studio Code, the plugin can assist with documentation, legacy code comprehension, and code completion.
To learn how to join the beta program and get started, visit our GitHub repository.