Skip to main content
Version: v2.4.0

AI Models

The AI Optimizer needs a language model for chat and Natural Language to SQL (NL2SQL). To use Retrieval-Augmented Generation (RAG), it also needs an embedding model. Configure the selected models in Configuration > Models.

Language Models

Language models generate chat responses, perform NL2SQL tasks, and can provide Vector Search features such as store discovery, document grading, and prompt rephrasing. Choose a model that supports the capabilities your application needs.

Choose a Chat Model with Reliable Tool Use

Tool use is a chat model's ability to recognize when it needs an external capability, select the appropriate tool, send valid structured arguments, and use the tool's result in its response. For example, a model might use a database tool to answer a question about your data instead of trying to answer from its existing knowledge.

Reliable tool use is important for agentic AI. An agent relies on the model to decide when to query data, retrieve relevant documents, or take another configured action. A model with weak tool use can select an inappropriate tool, produce invalid arguments, repeat unnecessary calls, or fail to use the result correctly.

When evaluating chat models, first confirm that the provider documents support for function or tool calling. Then test each candidate with representative tasks that require the agent to choose the correct tool, provide valid arguments, handle a tool error, and accurately use the returned result. Prefer the model that performs these tasks consistently in your environment, rather than selecting one based only on general chat quality.

Example: granite4.1:8b

To evaluate the granite4.1:8b model:

  1. Open the Granite 4.1 8B model card. Its Tool-calling section states that it "comes with enhanced tool calling capabilities, enabling seamless integration with external functions and APIs."
  2. Configure the model and try a task that needs a tool, such as enabling NL2SQL for information that is available only in a database. Confirm that the model calls the expected tool with appropriate inputs and uses the returned data in its answer.

Documented support is a starting point, not a guarantee that a model will work well for every task. Test the model with the tools and requests that your application uses.

Embedding Models

Embedding models convert documents and queries into vectors for similarity search. Choose an embedding model that fits your data, performance requirements, and deployment constraints.

Choose and Set Up a Provider

The AI Optimizer uses LiteLLM to connect to model providers and compatible endpoints. Whether you run models locally or use a cloud provider, choose the option that fits your deployment, data-handling requirements, and available hardware.


OCI GenAI

OCI GenAI is a fully managed service in Oracle Cloud Infrastructure (OCI) for integrating language models into writing assistance, summarization, analysis, and chat applications.

Follow the Getting Started guide to deploy the service in your OCI tenancy.

OCI GenAI models are not added one at a time. Instead, the AI Optimizer loads the chat and embedding models available in your configured Region—either interactively from the OCI tab, or automatically at startup when a usable profile already has a GenAI Compartment OCID and Region persisted. See Loading OCI GenAI Models for the client workflow.

Skip the GUI!

The GenAI Compartment OCID and Region can be supplied through the Models environment variables.

Alternatively, specify the following in the ~/.oci/config file under the appropriate OCI profile:

genai_compartment_id=<OCI Compartment OCID of the OCI GenAI Service>
genai_region=<OCI GenAI Region>

CPU Optimization

When running models on CPU-only systems (without GPU acceleration), smaller models provide significantly better performance and responsiveness. The AI Optimizer includes built-in optimizations for CPU-friendly models.

Small local models are often a better fit for CPU-only systems. When an Ollama server is configured with AIO_ON_PREM_OLLAMA_URL, the AI Optimizer discovers pulled Ollama models and enables them automatically.

Examples of CPU-friendly model choices include:

ModelParametersMax TokensUse Case
llama3.2:1b1B2048Fast responses, simple Q&A
granite4.1:8b8B2048Balanced performance/quality
gemma3:1b1B2048Lightweight, efficient

Vector Search Optimization

When a selected model name includes a parameter count below 7B, such as llama3.2:1b or gemma3:1b, the AI Optimizer automatically disables these Vector Search features:

  • Store Discovery: Uses the Language Model to select the most appropriate Vector Store. When disabled, you must select the Vector Store manually if more than one is available.
  • Document Grading: Evaluates retrieved documents for relevance before they are used.
  • Prompt Rephrase: Rephrases queries using the conversation context to improve retrieval.

Disabling these features reduces the number of Language Model calls and can significantly improve response times. You can manually enable or disable each feature using the checkboxes in the Vector Search sidebar, regardless of model size.

Performance Tips

  1. Model Selection: Choose the smallest model that meets your quality requirements
  2. Reduce Top K: Lower the number of retrieved documents (for example, Top K = 3-5)
  3. Lower Max Tokens: Reduce maximum output tokens to speed up generation
  4. Temperature 0: Use temperature 0 for deterministic, faster responses