Skip to content

Instantly share code, notes, and snippets.

View Sumanth077's full-sized avatar
🎯
Focusing

Sumanth Sumanth077

🎯
Focusing
View GitHub Profile
@Sumanth077
Sumanth077 / test_model.py
Created October 13, 2025 10:11
Test the locally running model via Python SDK.
from clarifai.client import Model
model = Model("https://clarifai.com/your-username/local-runner-app/models/local-runner-model")
response = model.predict(prompt="Explain retrieval-augmented generation.")
print(response)
@Sumanth077
Sumanth077 / start_local_runner.sh
Created October 13, 2025 10:09
Start your Local Runner to serve the model via public API.
clarifai model local-runner
@Sumanth077
Sumanth077 / install_dependencies.sh
Created October 13, 2025 10:08
Install required Python packages for the model.
pip install -r requirements.txt
@Sumanth077
Sumanth077 / initialize_huggingface_model.sh
Created October 13, 2025 10:03
Scaffold a Hugging Face model directory for Local Runner.
clarifai model init --toolkit huggingface --model-name Qwen/Qwen3-1.7B
@Sumanth077
Sumanth077 / set_hf_token.sh
Created October 13, 2025 10:01
Set Hugging Face access token as environment variable
export HF_TOKEN=YOUR_HF_ACCESS_TOKEN
@Sumanth077
Sumanth077 / set_clarifai_pat.sh
Created October 13, 2025 09:57
Set Clarifai Personal Access Token as environment variable.
export CLARIFAI_PAT=YOUR_PERSONAL_ACCESS_TOKEN
@Sumanth077
Sumanth077 / login.sh
Created October 13, 2025 09:54
Logs in and sets up Clarifai configuration context.
clarifai login
@Sumanth077
Sumanth077 / install_cli.sh
Created October 13, 2025 09:53
Installs or updates the Clarifai CLI.
pip install --upgrade clarifai
@Sumanth077
Sumanth077 / agent_team_finance.py
Created September 26, 2025 20:58
Team of agents
from agno.team import Team
from agno.tools.yfinance import YFinanceTools
# Web research agent
web_agent = Agent(
name="Web Research Agent",
role="Fetch news and current information",
model=OpenAILike(
id="openai/chat-completion/models/gpt-oss-120b",
api_key=os.environ["CLARIFAI_PAT"],
@Sumanth077
Sumanth077 / thai_recipe_agent.py
Created September 26, 2025 20:57
Agent with a knowledge base.
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.lancedb import LanceDb, SearchType
import nest_asyncio; nest_asyncio.apply()
embedder = OpenAIEmbedder(
id="openai/embed/models/text-embedding-ada-002",
api_key=os.environ["CLARIFAI_PAT"],
base_url="https://api.clarifai.com/v2/ext/openai/v1"
)