Simira kuzvirimo
LlamaIndex

Ma-framework nema-SDK

Shandisa LlamaIndex ne-Shannon

Shandisa OpenAILike class yeLlamaIndex ne-base URL yeShannon; chat, streaming ne-function calling zvinoshanda kuburikidza nayo.

  • Yakaedzwa 2026 Mbu 7
  • OpenAI Chat Completions
  • Anenge 2 min

Nezve LlamaIndex

LlamaIndex i-framework ye-Python ne-TypeScript yema-app anoverenga magwaro ako: indexing, retrieval, agents ne-workflows. Class yayo ye-OpenAILike inotaura ne-server ipi neipi ye-OpenAI-compatible, saka Shannon models dzinogona kupindura mibvunzo, kudana tools nekufambisa LlamaIndex agents.

Zvaunoda

Shannon API key
Makiyi nekushandiswa
Base URL
https://api.shannon-ai.com/v1 Endpoint: /v1/chat/completions
Snippet yega yega iri pazasi inotevera sarudzo yako.

Iseta

  1. Isa OpenAI-like integration

    Shell
    pip install llama-index-core llama-index-llms-openai-like
  2. Gadzira model uye u-stream

    is_chat_model=True inoshandisa chat endpoint; is_function_calling_model=True inobvumira ma-agent kudana tools; context_window inoudza LlamaIndex kuti mashoko mangani anokwana.

    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. Dana 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'})]

Ongorora kuti inoshanda

Tumira: Mhanyisa streaming sample.

Unofanira kuona: Ruvara runoprintwa sezvarunosvika mu-stream.

Ma-model anokodzera LlamaIndex

Id imwe neimwe iri pazasi inozadzisa zvinodiwa ne LlamaIndex. Yekutanga ndiyo default mu-snippets.

Id ye-modelContext windowOutput yakakuraKupinza mifananidzo
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 Hongu
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 Hongu
shannon-3 196,608 65,536 Hongu
shannon-coder-1 131,072 65,536 Kwete

Ma-setting e-model

LlamaIndex inokumbira ma-value aya. Anoenderana ne-model yawasarudza.

SettingKukoshaSei
context_window 1022976 LlamaIndex inokwanisa mashoko akatorwa mu-tokens idzi zvishoma.

Zvakanaka kuziva

  • Pasina is_chat_model=True, OpenAILike inodana /v1/completions endpoint yekare, inodzosa 404 paShannon.
  • Pasina is_function_calling_model=True, ma-agent anodzokera kutext-based tool use.
  • Retrieval inoda embedding model; Shannon haishandi /v1/embeddings, saka isa embed_model yeLlamaIndex kune imwe provider kana local model.

Mazano

  1. Isa Settings.llm = llm kamwe chete kuti index, query engine ne-agent imwe neimwe ishandise Shannon.
  2. FunctionAgent ne-ReActAgent dzese dzinotora llm iyi.
  3. Kumagwaro akareba, sarudza model ine window huru uye simudza context_window kuti ienderane.

Kugadzirisa matambudziko

ChiratidzoChikonzeroGadziriro
404 pa-/v1/completions is_chat_model haina kuiswa. Tumira is_chat_model=True.
Indexing inokumbira OpenAI key Default embedding model yeLlamaIndex ndeyeOpenAI. Isa Settings.embed_model kune embedding model yaunayo.
401 Unauthorized Key haipo, yanyorwa zvisizvo kana kuti yakachinjwa. Kopa key zvakare kubva ku-Keys & usage; inotanga ne sk-.
context_length_exceeded / “prompt is too long” Hurukuro yakareba kupfuura window ye-model. Tanga chat itsva, rega tool iidimbure, kana sarudza model ine window huru.
insufficient_quota Balance yako haikwani kubhadhara request. Wedzera credit kana chinja plan; request haidzokororwi yoga.

Mibvunzo

LlamaIndex inoshanda neShannon here?

Hongu, kuburikidza ne-OpenAILike ne-api_base="https://api.shannon-ai.com/v1".

Ma-agent eLlamaIndex anogona kudana tools paShannon here?

Hongu; ne-is_function_calling_model=True model inodzosa native tool calls, dzatakaedza.

Sarudza mutauro wako

Mitauro yese yakafanana. Sarudza yaunoda kushandisa.

Yuropu

Middle East neNorth Africa

Nezasi kweAsia

Nezasi-mabvazuva eAsia

Mabvazuva eAsia

Central Asia neCaucasus

Afrika

Oceania

Yakagadzirwa neYekare