Skip to content
LlamaIndex

Frameworks and SDKs

Use LlamaIndex with Shannon

Use LlamaIndex's OpenAILike class with Shannon's base URL; chat, streaming and function calling work through it.

  • Tested Nov 7, 2026
  • OpenAI Chat Completions
  • About 2 min

About LlamaIndex

LlamaIndex is a Python and TypeScript framework for apps that read your documents: indexing, retrieval, agents and workflows. Its OpenAILike class talks to any OpenAI-compatible server, so Shannon models can answer questions, call tools and drive LlamaIndex agents.

What you need

A Shannon API key
Keys & usage
Base URL
https://api.shannon-ai.com/v1 Endpoint: /v1/chat/completions
Every snippet below follows your choice.

Set it up

  1. Install the OpenAI-like integration

    Shell
    pip install llama-index-core llama-index-llms-openai-like
  2. Create the model and stream

    is_chat_model=True uses the chat endpoint; is_function_calling_model=True lets agents call tools; context_window tells LlamaIndex how much text fits.

    Python
    from llama_index.llms.openai_like import OpenAILike
    
    llm = OpenAILike(
        model="Kimi-K3-uncensored-NVFP4",
        api_base="https://api.shannon-ai.com/v1",
        api_key="YOUR_API_KEY",
        context_window=1022976,
        is_chat_model=True,
        is_function_calling_model=True,
    )
    
    for r in llm.stream_complete("Name three colours a cat can be."):
        print(r.delta, end="", flush=True)
  3. Call tools

    Python
    from llama_index.core.tools import FunctionTool
    
    def get_weather(city: str) -> str:
        """Weather for a city."""
        return f"Sunny in {city}"
    
    tool = FunctionTool.from_defaults(fn=get_weather)
    resp = llm.chat_with_tools([tool], user_msg="What is the weather in Oslo?")
    print(llm.get_tool_calls_from_response(resp))  # [ToolSelection(tool_name='get_weather', tool_kwargs={'city': 'Oslo'})]

Check that it works

Send: Run the streaming sample.

You should see: The colours printed as they stream in.

Models that fit LlamaIndex

Every id below meets what LlamaIndex needs. The first one is the default in the snippets.

Model idContext windowMax outputImage input
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 Yes
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 Yes
shannon-3 196,608 65,536 Yes
shannon-coder-1 131,072 65,536 No

Model settings

LlamaIndex asks for these values. They follow the model you picked.

SettingValueWhy
context_window 1022976 LlamaIndex fits retrieved text into this many tokens.

Good to know

  • Without is_chat_model=True, OpenAILike calls the old /v1/completions endpoint, which returns 404 on Shannon.
  • Without is_function_calling_model=True, agents fall back to text-based tool use.
  • Retrieval needs an embedding model; Shannon does not serve /v1/embeddings, so set LlamaIndex's embed_model to another provider or a local model.

Tips

  1. Set Settings.llm = llm once so every index, query engine and agent uses Shannon.
  2. FunctionAgent and ReActAgent both take this llm.
  3. For long documents, pick a model with a large window and raise context_window to match.

Troubleshooting

SymptomCauseFix
404 on /v1/completions is_chat_model is not set. Pass is_chat_model=True.
Indexing asks for an OpenAI key LlamaIndex's default embedding model is OpenAI's. Set Settings.embed_model to an embedding model you have.
401 Unauthorized The key is missing, mistyped or rotated. Copy the key again from Keys & usage; it starts with sk-.
context_length_exceeded / "prompt is too long" The conversation is longer than the model's window. Start a new chat, let the tool compact it, or pick a model with a larger window.
insufficient_quota Your balance cannot pay for the request. Top up or change plan; the request is not retried by itself.

Questions

Does LlamaIndex work with Shannon?

Yes, through OpenAILike with api_base="https://api.shannon-ai.com/v1".

Can LlamaIndex agents call tools on Shannon?

Yes; with is_function_calling_model=True the model returns native tool calls, which we tested.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical