Introducing any-llm: A unified API to access any LLM provider
β’
3
None defined yet.
any-agent
(1.1.0 ) is out πfrom any_llm import completion
import os
# Make sure you have the appropriate environment variable set
assert os.environ.get('MISTRAL_API_KEY')
# Basic completion
response = completion(
model="mistral/mistral-small-latest", # <provider_id>/<model_id>
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
# google_expert.py
from any_agent import AgentConfig, AnyAgent
from any_agent.config import ServingConfig
from any_agent.tools import search_web
agent = AnyAgent.create(
"google",
AgentConfig(
name="google_expert",
model_id="gpt-4.1-nano",
instructions="You must use the available tools to find an answer",
description="An agent that can answer questions about the Google Agents Development Kit (ADK).",
tools=[search_web]
)
)
agent.serve(ServingConfig(port=5001))