2027 setup guide · RAG frameworks

LlamaIndex with Plugsky

LlamaIndex's OpenAILike class is built for endpoints like Plugsky, but its defaults assume a small context window and no tool calling. Set both before you index anything.

Abstract illustration of documents, embeddings and a model endpoint
Illustration: a retrieval pipeline calling a compatible model. Plugsky Editorial Team.

LlamaIndex is a Python framework for retrieval and agent workflows. Its OpenAI integration is optimised for the official OpenAI API; for third-party endpoints it provides OpenAILike, a thin wrapper that keeps the OpenAI request shape but lets you set the base URL. Plugsky exposes an OpenAI-compatible API at https://api.plugsky.com/v1, so OpenAILike is the correct entry point.

The class is small and the defaults are opinionated. Two parameters are required and easy to misread: is_chat_model and is_function_calling_model. The context window defaults to 3,900 tokens, and the function-calling flag defaults to false. A RAG pipeline built on the defaults will truncate documents and skip tool calls, then look like a retrieval problem.

OpenAILike parameters for Plugsky, checked 23 November 2026
ParameterWhat to setWhy it matters
modelA published Plugsky model IDPassed through without translation.
api_basehttps://api.plugsky.com/v1The root of the compatible API.
api_keyA Plugsky keyUse a secret reference, not a literal in a notebook.
is_chat_modelTrue for chat modelsThe default is False; a chat model called as a completion model fails or degrades.
is_function_calling_modelTrue only if the model supports toolsThe default is False, which disables tool use in agents.
context_windowThe model's real windowThe default is 3,900; leaving it there truncates long documents.

Why OpenAILike exists

LlamaIndex's main OpenAI class is written against the official API. OpenAILike is a thin wrapper around that model class for third-party tools that provide an OpenAI-compatible API. It keeps the message format and the client, and adds the parameters a compatible endpoint needs: api_base, is_chat_model, is_function_calling_model and an explicit context window.

That design is useful because it preserves the rest of LlamaIndex: the same prompt templates, the same response synthesisers and the same agent abstractions work with a different endpoint. The wrapper is not a compatibility layer for every provider extension. It is a way to point the OpenAI-shaped path at a different host.

The setup pattern

Install llama-index-llms-openai-like, import OpenAILike, and construct it with the model ID, the Plugsky base URL, the key, the real context window, is_chat_model set to true and is_function_calling_model set according to the model. Then pass the instance to a query engine, a chat engine or an agent. The rest of the pipeline does not need to know which provider is behind it.

A reasonable first configuration uses a general chat model for synthesis and keeps the window honest. If the model supports tool calling, enable it and test one tool call before building an agent. If it does not, leave the flag false and use a workflow that does not depend on tools; turning it on does not add the capability.

Keep the key out of notebooks. LlamaIndex examples often set environment variables inline, which is fine for a local test and wrong for a repository that other people clone.

Keep the model ID and context window in configuration, not in code. A model swap then becomes a config change with a rollback, and the context window can be updated when the provider publishes a new limit. Hard-coded values spread across notebooks are how a pipeline ends up with three different assumptions about the same model.

  • Package: llama-index-llms-openai-like
  • Class: OpenAILike
  • api_base: https://api.plugsky.com/v1
  • is_chat_model: True
  • context_window: the model's documented window
  • max_retries and timeout: set deliberately, not by default

The defaults that bite

The API reference lists context_window with a default of 3,900. That number is a safe fallback for an unknown model, not a description of the model you are using. If you ingest a long contract and ask for a summary, a 3,900-token window will drop much of it before the model sees the question. The output looks plausible, which is worse than an error.

is_function_calling_model defaults to False. An agent built with tools will not call them unless the flag is true and the model actually supports the OpenAI tool schema. The failure is quiet: the agent answers from the prompt and never invokes the tool.

The client also defaults to three retries and a 60-second timeout. Those are reasonable for a chat request and less reasonable for a long synthesis call. Set them from the workload rather than accepting them.

RAG is a second integration

A chat model is only half of a RAG pipeline. LlamaIndex uses a separate embedding model to build the vector index, and the embedding model must be configured on its own. Plugsky's model catalogue is the place to confirm which embedding models are available; do not assume a chat model can produce embeddings.

The embedding dimension has to match the index. If you switch embedding models after indexing, rebuild the index rather than mixing vectors. A mismatch often appears as poor retrieval rather than an exception, so teams spend days tuning prompts for a data problem.

Chunking is the other half of retrieval. A chunk that is too large dilutes the embedding; too small and the answer lacks context. Test chunk sizes against the questions your users actually ask, and keep metadata such as matter, patient or policy ID so the retriever can filter before the model sees anything.

Test retrieval before generation. Ask a question whose answer exists in one document, and inspect the retrieved chunks. If the right chunk is not there, a better chat model will not fix the answer. Record the embedding model and dimension next to the index; a future rebuild will need both.

When a competitor wins

LlamaIndex's native OpenAI integration wins when you need the official API's full feature set and do not need a different endpoint. A local Ollama or Hugging Face model wins when documents cannot leave the machine and the team accepts a smaller model. A managed RAG platform wins when the team does not want to operate an index and a retrieval service.

Plugsky wins when the RAG stack is standard OpenAI-shaped, the team wants a flat monthly plan and the deployment has to move from shared API to private VPC or air-gapped infrastructure. The limit is catalogue size: 39 public model IDs, so confirm both the chat model and the embedding model you need are available before you build the index.

Verdict

Use OpenAILike with the Plugsky base URL, an explicit context window and the function-calling flag set to match the model. Configure embeddings separately, rebuild the index when the embedding model changes, and test retrieval before judging the answer.

Choose Plugsky when LlamaIndex is the retrieval layer for a product that needs a predictable bill and a private deployment path. Choose the native OpenAI integration or a local model when official features or complete offline operation matter more than a single compatible endpoint.

Frequently asked questions

What is OpenAILike in LlamaIndex?

OpenAILike is a thin wrapper around LlamaIndex's OpenAI model class for third-party tools that provide an OpenAI-compatible API. It adds api_base and model capability flags.

Why is my long document truncated?

OpenAILike's context_window defaults to 3,900 tokens. Set it to the model's real window before ingesting long documents.

Why does my agent not call tools?

is_function_calling_model defaults to False. Set it to True only if the model supports OpenAI-style tool calling, then test a real tool call.

Can I use a Plugsky chat model for embeddings?

Embeddings are a separate model class. Check the Plugsky model catalogue for an embedding model and configure it explicitly in LlamaIndex.

Do I need to rebuild the index if I change models?

If the embedding model or its dimension changes, yes. A chat model change does not require reindexing.

Related

Sources

  1. LlamaIndex: OpenAILike API reference · 23 Nov 2026
  2. LlamaIndex: OpenAI LLM integration · 23 Nov 2026
  3. LlamaIndex: Grok via OpenAILike · 23 Nov 2026
  4. Plugsky API quickstart · 23 Nov 2026