Skip to main content

Python client for CoreLLM SDK — LLM gateway running Ollama on Hugging Face Spaces

Project description

CoreLLM SDK

The simplest way to use LLMs.

📦 Install from PyPI

pip install corellm-sdk

🤖 Available Models

The following models are available on the server. Do not use any other model names.

  • "gemma4:e4b" - text, vision, tools, thinking, audio, context=128k
  • "devstral:24b" - text, tools, context=128k
  • "cogito:14b" - text, tools, thinking, context=128k
  • "ornith:9b" - Text, thinking, tools, context=256k
  • "lfm2.5-thinking:1.2b" - ultra fast, tools, thinking, context=32k
  • "qwen3-embedding:8b" - embedding
  • "robit/ornith-vision:9b" - vision, tools, thinking

🚀 Quickstart

The new CoreLLMChat class wraps everything into a single, cohesive, LangChain-compatible chat model.

from corellm_sdk import CoreLLMChat

# Initialize the engine
llm = CoreLLMChat(
    model="gemma4:e4b"
)

🧩 LangChain & LangGraph Support

Use it seamlessly with your existing LangChain workflows:

from langchain_core.messages import HumanMessage
from langchain_core.prompts import ChatPromptTemplate

# Direct usage
response = llm.invoke([HumanMessage(content="Hello!")])
print(response.content)

# With Chains
chain = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    ("human", "{question}"),
]) | llm

print(chain.invoke({"question": "What is Python?"}).content)

🌐 Standard OpenAI & Groq Compatibility

You can use the standard ChatOpenAI or ChatGroq classes seamlessly as drop-in replacements for your LangChain workflows!

from langchain_openai import ChatOpenAI
from langchain_groq import ChatGroq

llm_openai = ChatOpenAI(model="gemma4:e4b")
llm_groq = ChatGroq(model="gemma4:e4b")

🛠 Raw APIs (raw_chat & generate)

If you want simpler formats:

# Raw Prompt Completion
print(llm.generate("Explain quantum physics in 1 sentence."))

# Standard Dict Chat
messages = [{"role": "user", "content": "Who are you?"}]
print(llm.raw_chat(messages))

🔄 Dynamic Model Switching

Switch models on the fly! The backend dynamically handles memory constraints and load transitions.

# Switch to another allowed model on your server!
llm.switch("devstral:24b")

print(llm.generate("Hello from Devstral!"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corellm_sdk-1.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corellm_sdk-1.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file corellm_sdk-1.1.1.tar.gz.

File metadata

  • Download URL: corellm_sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for corellm_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 9cfecd1a58b724e3047e78a5e7abda02a129824ce0c7b0b7d89251e767620d10
MD5 a5e36a9113db3485cc4259ca24d4fbed
BLAKE2b-256 19aa4f13acefabd864fd3307d3cc2a0c4d4eecf16aab5dddc9cbe5f196c46adf

See more details on using hashes here.

File details

Details for the file corellm_sdk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: corellm_sdk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for corellm_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 454c6876cac33a81b20499ae18797c765ecd53e78a9d67d4f078414e48caa915
MD5 7d148b227f75c9a4187a8453ebe4d544
BLAKE2b-256 6b399c0f29b4b0e72fdfdec6ec775f540e5a93bfe283b8616c4039b7b2d859a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page