• bitcoinBitcoin(BTC)$84,862.001.65%
  • ethereumEthereum(ETH)$2,724.912.95%
  • tetherTether(USDT)$1.000.01%
  • binancecoinBNB(BNB)$779.761.34%
  • rippleXRP(XRP)$1.587.69%
  • usd-coinUSDC(USDC)$1.000.01%
  • solanaSolana(SOL)$120.956.79%
  • tronTRON(TRX)$0.337047-0.63%
  • zcashZcash(ZEC)$1,603.507.99%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.030.00%
  • HyperliquidHyperliquid(HYPE)$93.642.95%
  • dogecoinDogecoin(DOGE)$0.0980405.78%
  • moneroMonero(XMR)$568.444.13%
  • chainlinkChainlink(LINK)$14.0114.60%
  • whitebitWhiteBIT Coin(WBT)$84.681.37%
  • USDSUSDS(USDS)$1.000.00%
  • cardanoCardano(ADA)$0.2558668.41%
  • RainRain(RAIN)$0.011931-0.45%
  • leo-tokenLEO Token(LEO)$8.83-0.91%
  • stellarStellar(XLM)$0.22288311.81%
  • bitcoin-cashBitcoin Cash(BCH)$337.010.97%
  • nearNEAR Protocol(NEAR)$5.0518.76%
  • uniswapUniswap(UNI)$9.586.02%
  • litecoinLitecoin(LTC)$70.566.28%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • CantonCanton(CC)$0.12198813.00%
  • avalanche-2Avalanche(AVAX)$10.614.36%
  • suiSui(SUI)$1.1419.57%
  • daiDai(DAI)$1.000.00%
  • USD1USD1(USD1)$1.000.02%
  • hedera-hashgraphHedera(HBAR)$0.0959457.05%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.431.48%
  • shiba-inuShiba Inu(SHIB)$0.0000066.28%
  • BittensorBittensor(TAO)$307.949.29%
  • crypto-com-chainCronos(CRO)$0.0660058.48%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • BitwayBitway(BTW)$1.108.43%
  • MemeCoreMemeCore(M)$1.20-2.91%
  • paypal-usdPayPal USD(PYUSD)$1.000.01%
  • OndoOndo(ONDO)$0.5528.99%
  • tether-goldTether Gold(XAUT)$4,301.090.86%
  • okbOKB(OKB)$120.742.03%
  • EthenaEthena(ENA)$0.24211918.53%
  • Circle USYCCircle USYC(USYC)$1.140.01%
  • Ripple USDRipple USD(RLUSD)$1.000.00%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • aaveAave(AAVE)$148.198.25%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.150.03%
  • mantleMantle(MNT)$0.681.50%
  • MorphoMorpho(MORPHO)$2.917.47%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

How to Build a Fully Autonomous Local Fleet-Maintenance Analysis Agent Using SmolAgents and Qwen Model

December 22, 2025
in AI & Technology
Reading Time: 5 mins read
A A
How to Build a Fully Autonomous Local Fleet-Maintenance Analysis Agent Using SmolAgents and Qwen Model
ShareShareShareShareShare

In this tutorial, we walk through the process of creating a fully autonomous fleet-analysis agent using SmolAgents and a local Qwen model. We generate telemetry data, load it through a custom tool, and let our agent reason, analyze, and visualize maintenance risks without any external API calls. At each step of implementation, we see how the agent interprets structured logs, applies logical filters, detects anomalies, and finally produces a clear visual warning for fleet managers. Check out the FULL CODES here.

Copy CodeCopiedUse a different Browser
print(" Installing libraries... (approx 30-60s)")
!pip install smolagents transformers accelerate bitsandbytes ddgs matplotlib pandas -q


import os
import pandas as pd
import matplotlib.pyplot as plt
from smolagents import CodeAgent, Tool, TransformersModel

We install all required libraries and import the core modules we rely on for building our agent. We set up SmolAgents, Transformers, and basic data-handling tools to process telemetry and run the local model smoothly. At this stage, we prepare our environment and ensure everything loads correctly before moving ahead. Check out the FULL CODES here.

YOU MAY ALSO LIKE

Google Adds Creepy Avatars To Gemini 3.8 Live’s Agents

Fastino Releases GLiNER2.5-Decide: A 340M Open-Weight Decision Model That Runs on CPU

Copy CodeCopiedUse a different Browser
fleet_data = {
   "truck_id": ["T-101", "T-102", "T-103", "T-104", "T-105"],
   "driver": ["Ali", "Sara", "Mike", "Omar", "Jen"],
   "avg_speed_kmh": [65, 70, 62, 85, 60],
   "fuel_efficiency_kml": [3.2, 3.1, 3.3, 1.8, 3.4],
   "engine_temp_c": [85, 88, 86, 105, 84],
   "last_maintenance_days": [30, 45, 120, 200, 15]
}
df = pd.DataFrame(fleet_data)
df.to_csv("fleet_logs.csv", index=False)
print("✅ 'fleet_logs.csv' created.")

We generate the dummy fleet dataset that our agent will later analyze. We create a small but realistic set of telemetry fields, convert it into a DataFrame, and save it as a CSV file. Here, we establish the core data source that drives the agent’s reasoning and predictions. Check out the FULL CODES here.

Copy CodeCopiedUse a different Browser
class FleetDataTool(Tool):
   name = "load_fleet_logs"
   description = "Loads vehicle telemetry logs from 'fleet_logs.csv'. Returns the data summary."
   inputs = {}
   output_type = "string"


   def forward(self):
       try:
           df = pd.read_csv("fleet_logs.csv")
           return f"Columns: {list(df.columns)}\nData Sample:\n{df.to_string()}"
       except Exception as e:
           return f"Error loading logs: {e}"

We define the FleetDataTool, which acts as the bridge between the agent and the underlying telemetry file. We give the agent the ability to load and inspect the CSV file to understand its structure. This tool becomes the foundation for every subsequent analysis the model performs. Check out the FULL CODES here.

Copy CodeCopiedUse a different Browser
print("How to Build a Fully Autonomous Local Fleet-Maintenance Analysis Agent Using SmolAgents and Qwen Model Downloading & Loading Local Model (approx 60-90s)...")
model = TransformersModel(
   model_id="Qwen/Qwen2.5-Coder-1.5B-Instruct",
   device_map="auto",
   max_new_tokens=2048
)
print("✅ Model loaded on GPU.")


agent = CodeAgent(
   tools=[FleetDataTool()],
   model=model,
   add_base_tools=True
)


print("\n🤖 Agent is analyzing fleet data... (Check the 'Agent' output below)\n")


query = """
1. Load the fleet logs.
2. Find the truck with the worst fuel efficiency (lowest 'fuel_efficiency_kml').
3. For that truck, check if it is overdue for maintenance (threshold is 90 days).
4. Create a bar chart comparing the 'fuel_efficiency_kml' of ALL trucks.
5. Highlight the worst truck in RED and others in GRAY on the chart.
6. Save the chart as 'maintenance_alert.png'.
"""
response = agent.run(query)


print(f"\n📝 FINAL REPORT: {response}")

We load the Qwen2.5 local model and initialize our CodeAgent with the custom tool. We then craft a detailed query outlining the reasoning steps we want the agent to follow and execute it end-to-end. This is where we watch the agent think, analyze, compute, and even plot, fully autonomously. Check out the FULL CODES here.

Copy CodeCopiedUse a different Browser
if os.path.exists("maintenance_alert.png"):
   print("\n📊 Displaying Generated Chart:")
   img = plt.imread("maintenance_alert.png")
   plt.figure(figsize=(10, 5))
   plt.imshow(img)
   plt.axis('off')
   plt.show()
else:
   print("⚠ No chart image found. Check the agent logs above.")

We check whether the agent successfully saved the generated maintenance chart and display it if available. We visualize the output directly in the notebook, allowing us to confirm that the agent correctly performed data analysis and plotting. This gives us a clean, interpretable result from the entire workflow.

In conclusion, we built an intelligent end-to-end pipeline that enables a local model to autonomously load data, evaluate fleet health, identify the highest-risk vehicle, and generate a diagnostic chart for actionable insights. We witness how easily we can extend this framework to real-world datasets, integrate more complex tools, or add multi-step reasoning capabilities for safety, efficiency, or predictive maintenance use cases. At last, we appreciate how SmolAgents empowers us to create practical agentic systems that execute real code, reason over real telemetry, and deliver insights immediately.


Check out the FULL CODES here. Also, feel free to follow us on Twitter and don’t forget to join our 100k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

The post How to Build a Fully Autonomous Local Fleet-Maintenance Analysis Agent Using SmolAgents and Qwen Model appeared first on MarkTechPost.

Credit: Source link

ShareTweetSendSharePin

Related Posts

Google Adds Creepy Avatars To Gemini 3.8 Live’s Agents
AI & Technology

Google Adds Creepy Avatars To Gemini 3.8 Live’s Agents

September 25, 2026
Fastino Releases GLiNER2.5-Decide: A 340M Open-Weight Decision Model That Runs on CPU
AI & Technology

Fastino Releases GLiNER2.5-Decide: A 340M Open-Weight Decision Model That Runs on CPU

September 25, 2026
Black Forest Labs Releases FLUX 3 Action: A 7B Open-Weights World Action Model That Tops RoboLab-120
AI & Technology

Black Forest Labs Releases FLUX 3 Action: A 7B Open-Weights World Action Model That Tops RoboLab-120

September 25, 2026
Warzone Is Adding A Button To Hide All The Goofy Skins
AI & Technology

Warzone Is Adding A Button To Hide All The Goofy Skins

September 24, 2026
Next Post
Michael Dell and his wife to donate .5 billion to ‘Trump Accounts’

Michael Dell and his wife to donate $6.5 billion to 'Trump Accounts'

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
Inside Colombia: Two weeks since 7.4 magnitude earthquake rocked the country

Inside Colombia: Two weeks since 7.4 magnitude earthquake rocked the country

September 24, 2026
Nicolas Cage Is Anything But Subtle In The Madden Trailer

Nicolas Cage Is Anything But Subtle In The Madden Trailer

September 24, 2026
Tesla Will Soon Roll Out FSD Supervised In The Czech Republic

Tesla Will Soon Roll Out FSD Supervised In The Czech Republic

September 21, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!