Skip to content
Semantic Kernel

Frameworks and SDKs

Use Semantic Kernel with Shannon

Give Semantic Kernel's OpenAIChatCompletion an AsyncOpenAI client pointed at Shannon; plugins and automatic function calling then run on Shannon models.

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

About Semantic Kernel

Semantic Kernel is Microsoft's open-source SDK for adding AI to apps in Python, C# and Java, with plugins, function calling and agents. Its OpenAI connector accepts your own OpenAI client, so a client pointed at Shannon makes every kernel function run on Shannon models.

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 Semantic Kernel

    Shell
    pip install semantic-kernel
  2. Add Shannon as the chat service

    Python
    from openai import AsyncOpenAI
    from semantic_kernel import Kernel
    from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
    
    client = AsyncOpenAI(base_url="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY")
    chat = OpenAIChatCompletion(ai_model_id="Kimi-K3-uncensored-NVFP4", async_client=client)
    
    kernel = Kernel()
    kernel.add_service(chat)
  3. Add a plugin and let the model call it

    Python
    import asyncio
    from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
    from semantic_kernel.connectors.ai.open_ai import OpenAIChatPromptExecutionSettings
    from semantic_kernel.contents import ChatHistory
    from semantic_kernel.functions import kernel_function
    
    class Weather:
        @kernel_function(description="Weather for a city")
        def get_weather(self, city: str) -> str:
            return f"Sunny, 18 C in {city}"
    
    kernel.add_plugin(Weather(), plugin_name="weather")
    settings = OpenAIChatPromptExecutionSettings(function_choice_behavior=FunctionChoiceBehavior.Auto())
    
    async def main():
        history = ChatHistory()
        history.add_user_message("What is the weather in Oslo?")
        print(await chat.get_chat_message_content(history, settings, kernel=kernel))
    
    asyncio.run(main())

Check that it works

Send: Run the plugin sample.

You should see: An answer built from the plugin's result: sunny, 18 C in Oslo.

Models that fit Semantic Kernel

Every id below meets what Semantic Kernel 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

Good to know

  • Pass your own AsyncOpenAI client: it is the way to set a base URL in the Python connector.
  • With FunctionChoiceBehavior.Auto(), the kernel runs the function and asks the model again, so one question takes two requests.

Tips

  1. chat.get_streaming_chat_message_contents(history, settings) streams the answer.
  2. In C#, the OpenAI connector takes an endpoint too: AddOpenAIChatCompletion(modelId: "<id>", endpoint: new Uri("https://api.shannon-ai.com/v1"), apiKey: key). We tested the Python SDK.
  3. Register several services with different service_ids to mix Shannon models in one kernel.

Troubleshooting

SymptomCauseFix
404 Not Found base_url lacks /v1. Use https://api.shannon-ai.com/v1.
The plugin is never called No function_choice_behavior in the settings. Use FunctionChoiceBehavior.Auto() and pass kernel=.
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 Semantic Kernel work with Shannon?

Yes, through OpenAIChatCompletion with an AsyncOpenAI client whose base_url is https://api.shannon-ai.com/v1.

Does automatic function calling work?

Yes; we ran a plugin call with FunctionChoiceBehavior.Auto().

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