#atom

Subtitle:

Open-source language models optimized for tool calling capabilities with strong performance at smaller parameter sizes


Core Idea:

Qwen models (particularly the Qwen 2.5 series) demonstrate exceptional function calling capabilities even at smaller parameter sizes (7B-14B), making them ideal for building locally-running agent applications that require tool interaction.


Key Principles:

  1. Parameter Efficiency:
    • Strong function calling performance with relatively small model sizes (7B, 14B)
  2. Open Source Availability:
    • Freely available for local deployment without API dependencies
  3. Structured Output Quality:
    • Consistent generation of properly formatted function calls with appropriate parameters
  4. Local Deployment Focus:
    • Optimized for running on consumer hardware with reasonable latency

Why It Matters:


How to Implement:

  1. Install Local Inference Engine:
    • Set up Ollama or similar tool for local model deployment
  2. Pull Appropriate Qwen Model:
    • ollama pull qwen2:14b-instruct for 14B parameter model
    • ollama pull qwen2:7b-instruct for 7B parameter model
  3. Configure Tool Definitions:
    • Define tools with clear names, descriptions and parameter specifications
  4. Implement Tool Calling Loop:
    • Use LangChain, LlamaIndex or custom code to implement the tool calling execution loop

Example:

import ollama

# Initialize with Qwen model
llm = ollama.Ollama(model="qwen2:14b-instruct")

# Create agent with tools
agent = create_react_agent(
    llm=llm,
    tools=[search_flights, book_flight, transfer_to_hotel_assistant]
)

# Run agent
agent.invoke({"input": "Find me flights to Tokyo next week"})

Connections:


References:

  1. Primary Source:
    • Berkeley Function Calling Leaderboard evaluation results
  2. Additional Resources:
    • Ollama documentation for deploying Qwen models
    • Qwen model documentation and GitHub repository

Tags:

#qwen #function-calling #open-source-llm #local-deployment #tool-calling #ollama


Connections:


Sources: