Connect with us

AI in Travel

Debugging and Tracing LLMs Like a Pro

Published

on


Debugging and Tracing LLMs Like a Pro
Image by Author | Canva

 

Introduction

 
Traditional debugging with print() or logging works, but it’s slow and clunky with LLMs. Phoenix provides a timeline view of every step, prompt, and response inspection, error detection with retries, visibility into latency and costs, and a complete visual understanding of your app. Phoenix by Arize AI is a powerful open-source observability and tracing tool specifically designed for LLM applications. It helps you monitor, debug, and trace everything happening in your LLM pipelines visually. In this article, we’ll walk through what Phoenix does and why it matters, how to integrate Phoenix with LangChain step by step, and how to visualize traces in the Phoenix UI.

 

What is Phoenix?

 
Phoenix is an open-source observability and debugging tool made for large language model applications. It captures detailed telemetry data from your LLM workflows, including prompts, responses, latency, errors, and tool usage, and presents this information in an intuitive, interactive dashboard. Phoenix allows developers to deeply understand how their LLM pipelines behave inside the system, identify and debug issues with prompt outputs, analyze performance bottlenecks, monitor using tokens and associated costs, and trace any errors/retry logic during execution phase. It supports consistent integrations with popular frameworks like LangChain and LlamaIndex, and also offers OpenTelemetry support for more customized setups.

 

Step-by-Step Setup

 

// 1. Installing Required Libraries

Make sure you have Python 3.8+ and install the dependencies:

pip install arize-phoenix langchain langchain-together openinference-instrumentation-langchain langchain-community

 

// 2. Launching Phoenix

Add this line to launch the Phoenix dashboard:

import phoenix as px
px.launch_app()

 
This starts a local dashboard at http://localhost:6006.

 

// 3. Building the LangChain Pipeline with Phoenix Callback

Let’s understand Phoenix using a use case. We are building a simple LangChain-powered chatbot. Now, we want to:

  • Debug if the prompt is working
  • Monitor how long the model takes to respond
  • Track prompt structure, model usage, and outputs
  • See all this visually instead of logging everything manually

 

// Step 1: Launch the Phoenix Dashboard in the Background

import threading
import phoenix as px

# Launch Phoenix app locally (access at http://localhost:6006)
def run_phoenix():
    px.launch_app()

threading.Thread(target=run_phoenix, daemon=True).start()

 

// Step 2: Register Phoenix with OpenTelemetry & Instrument LangChain

from phoenix.otel import register
from openinference.instrumentation.langchain import LangChainInstrumentor

# Register OpenTelemetry tracer
tracer_provider = register()

# Instrument LangChain with Phoenix
LangChainInstrumentor().instrument(tracer_provider=tracer_provider)

 

// Step 3: Initialize the LLM (Together API)

from langchain_together import Together

llm = Together(
    model="meta-llama/Llama-3-8b-chat-hf",
    temperature=0.7,
    max_tokens=256,
    together_api_key="your-api-key",  # Replace with your actual API key
)

 
Please don’t forget to replace the “your-api-key” with your actual together.ai API key. You can get it using this link.

 

// Step 4: Define the Prompt Template

from langchain.prompts import ChatPromptTemplate

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    ("human", "{question}"),
])

 

// Step 5: Combine Prompt and Model into a Chain

 

// Step 6: Ask Multiple Questions and Print Responses

questions = [
    "What is the capital of France?",
    "Who discovered gravity?",
    "Give me a motivational quote about perseverance.",
    "Explain photosynthesis in one sentence.",
    "What is the speed of light?",
]

print("Phoenix running at http://localhost:6006\n")

for q in questions:
    print(f" Question: {q}")
    response = chain.invoke({"question": q})
    print(" Answer:", response, "\n")

 

// Step 7: Keep the App Alive for Monitoring

try:
    while True:
        pass
except KeyboardInterrupt:
    print(" Exiting.")

 

Understanding Phoenix Traces & Metrics

 
Before seeing the output, we should first understand Phoenix metrics. You will need to first understand what traces and spans are:
Trace: Each trace represents one full run of your LLM pipeline. For example, each question like “What is the capital of France?” generates a new trace.
Spans: Each trace is mixed of multiple spans, each representing a stage in your chain:

  • ChatPromptTemplate.format: Prompt formatting
  • TogetherLLM.invoke: LLM call
  • Any custom components you add

Metrics Shown per Trace
 

Metric Meaning & Importance
Latency (ms) Measures total time for full LLM chain execution, including prompt formatting, LLM response, and post-processing. Helps identify performance bottlenecks and debug slow responses.
Input Tokens Number of tokens sent to the model. Important for monitoring input size and controlling API costs, since most usage is token-based.
Output Tokens Number of tokens generated by the model. Useful for understanding verbosity, response quality, and cost impact.
Prompt Template Displays the full prompt with inserted variables. Helps confirm whether prompts are structured and filled in correctly.
Input / Output Text Shows both user input and the model’s response. Useful for checking interaction quality and spotting hallucinations or incorrect answers.
Span Durations Breaks down the time taken by each step (like prompt creation or model invocation). Helps identify performance bottlenecks within the chain.
Chain Name Specifies which part of the pipeline a span belongs to (e.g., prompt.format, TogetherLLM.invoke). Helps isolate where issues are occurring.
Tags / Metadata Extra information like model name, temperature, etc. Useful for filtering runs, comparing results, and analyzing parameter impact.

 

Now visit http://localhost:6006 to view the Phoenix dashboard. You will see something like:
 
Phoenix dashboardPhoenix dashboard
 
Open the first trace to view its details.
 
Phoenix first tracePhoenix first trace

 

Wrapping Up

 
To wrap it up, Arize Phoenix makes it incredibly easy to debug, trace, and monitor your LLM applications. You don’t have to guess what went wrong or dig through logs. Everything’s right there: prompts, responses, timings, and more. It helps you spot issues, understand performance, and just build better AI experiences with way less stress.
 
 

Kanwal Mehreen is a machine learning engineer and a technical writer with a profound passion for data science and the intersection of AI with medicine. She co-authored the ebook “Maximizing Productivity with ChatGPT”. As a Google Generation Scholar 2022 for APAC, she champions diversity and academic excellence. She’s also recognized as a Teradata Diversity in Tech Scholar, Mitacs Globalink Research Scholar, and Harvard WeCode Scholar. Kanwal is an ardent advocate for change, having founded FEMCodes to empower women in STEM fields.



Source link

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

AI in Travel

Tourism Malaysia And HONOR Malaysia Collaborate To Promote Visit Malaysia 2026 Through AI Technology

Published

on


Saturday, August 2, 2025

Tourism Malaysia has teamed up with HONOR Technology (Malaysia) to change how the country promotes tourism. Through a Memorandum of Collaboration (MoC), both organizations will use new technology, specifically AI-driven digital storytelling, to improve Malaysia’s visibility in global tourism. This partnership aims to increase Malaysia’s presence in the international tourism market, especially ahead of the upcoming Visit Malaysia 2026 (VM2026) campaign.

A Game-Changing Collaboration

The partnership between Tourism Malaysia and HONOR Malaysia marks a significant shift in the tourism industry’s approach to promotional strategies. As the tourism sector increasingly embraces technological advancements, this collaboration is a prime example of how innovation can be leveraged to meet modern demands. Both organizations are committed to utilizing AI-powered technology to create engaging, interactive, and visually stunning content that will appeal to a broad audience, particularly the younger, digitally savvy generation.

Through the use of HONOR’s advanced AI-powered mobile technology, the partnership will deliver a series of creative initiatives designed to engage local and international audiences. The aim is to connect with travelers in a more dynamic, personal way, leveraging AI to produce content that is not only visually striking but also reflective of the diverse cultural and scenic beauty of Malaysia.

Key Initiatives Under the Partnership

The collaboration will kick off with a series of interactive campaigns designed to bring Malaysia’s most iconic tourist attractions to the forefront. One of the standout features of the partnership is a nationwide photography competition that will invite both local and international participants to capture Malaysia’s stunning landscapes and cultural landmarks. HONOR’s AI-enhanced smartphones will be the primary tool for participants, enabling them to capture high-quality images that showcase the country’s rich diversity.

In addition to the photography competition, the initiative will include guided photo tours at major tourist spots across Malaysia, giving travelers the opportunity to explore the country’s beauty through the lens of a professional photographer. These tours will provide participants with valuable insights into the history, culture, and natural wonders of Malaysia, helping to foster a deeper connection to the country.

Another highlight of the collaboration will be creative workshops, where industry experts will guide participants through the process of creating compelling travel content. These workshops will provide attendees with the skills they need to produce high-quality digital content, from photography to video production, all while highlighting Malaysia’s attractions. The workshops will also serve as a platform for cultural exchange, allowing local and international participants to share their experiences and ideas.

Furthermore, the collaboration will feature art exhibitions showcasing AI-enhanced visuals captured using HONOR smartphones. These exhibitions will offer a new perspective on Malaysia’s tourism offerings, blending technology with art to create visually captivating displays. The exhibitions will serve as both a celebration of Malaysia’s cultural heritage and a forward-thinking approach to tourism marketing.

The Role of AI and Mobile Technology

HONOR Malaysia’s role in this collaboration is crucial, as the company’s mobile technology and AI capabilities will be integral to curating visually compelling content. By utilizing AI-powered features such as scene recognition and photo enhancement, the smartphones will enable users to create professional-quality images with ease. This approach not only highlights the beauty of Malaysia but also encourages travelers to explore the country’s destinations in a more immersive way.

Tourism Malaysia’s involvement in the partnership focuses on facilitating access to the country’s top tourist attractions, providing logistical support, and amplifying the campaign’s reach through its extensive global tourism network. The government agency has long been at the forefront of efforts to promote Malaysia as a top tourist destination, and this collaboration with HONOR represents a new chapter in the country’s tourism marketing strategy.

Embracing Innovation to Appeal to Global Audiences

As Malaysia prepares for the Visit Malaysia 2026 campaign, the collaboration between Tourism Malaysia and HONOR Malaysia is a timely step towards modernizing the country’s approach to tourism promotion. By embracing AI and mobile creativity, the initiative aims to engage younger, tech-savvy travelers who are increasingly seeking interactive and personalized travel experiences. The partnership also aligns with global marketing trends, as more and more brands leverage digital platforms and emerging technologies to connect with consumers.

This collaboration is a significant move in ensuring that Malaysia’s tourism industry remains competitive in the global market. By focusing on user-generated content and encouraging creativity, the campaign aims to not only promote Malaysia’s scenic beauty and cultural richness but also foster emotional and visual connections with travelers worldwide. The campaign’s use of AI and technology ensures that Malaysia’s tourism offerings are showcased in a modern, dynamic light, capturing the attention of audiences across the globe.

Strengthening Public-Private Partnerships for Tourism Growth

The collaboration between Tourism Malaysia and HONOR Malaysia exemplifies the power of public-private partnerships in driving tourism growth. By combining the expertise and resources of both organizations, the partnership is poised to make a significant impact on Malaysia’s tourism sector. This MoC is also a testament to the growing recognition of the importance of innovation and technology in shaping the future of travel marketing.

As the Visit Malaysia 2026 campaign approaches, the collaboration is set to serve as a benchmark for how technology can be integrated into tourism promotion. The initiative will not only help boost Malaysia’s visibility in the global tourism market but also inspire other nations to embrace technology as a means of enhancing their tourism offerings. By blending tradition with innovation, Tourism Malaysia and HONOR Malaysia are setting a new standard for the future of travel marketing.

A Groundbreaking Step

In conclusion, the partnership between Tourism Malaysia and HONOR Malaysia is a significant move toward changing how tourism is promoted in the digital age. By using AI-driven digital storytelling and mobile technology, the collaboration seeks to improve Malaysia’s presence in global tourism and involve both local and international audiences in engaging and creative ways. As the Visit Malaysia 2026 campaign approaches, this partnership represents the changing connection between technology and tourism, paving the way for a more immersive and interactive travel experience for everyone.



Source link

Continue Reading

AI in Travel

Revival of Ansett Australia with AI – What You Need to Know

Published

on


Saturday, August 2, 2025

The Revival of Ansett Australia has taken a surprising turn, formerly one of the leading airlines in Australia has made an incredible comeback – albeit not as a full-service airline. The reintroduction of the airline was conceived by Melbourne entrepreneur, Constantine Frantzekos who saw an opportunity to reinvigorate the Ansett name and offer a more tailored and cost-effective means of flying, Through the platform, known as Ansett. Travel, powered by cutting-edge artificial intelligence, Frantzekos aims to transform how Australians plan and experience travel, bringing back the legacy of Ansett in a modern, digital form.

From Airline to AI Travel Platform

Launched many decades ago Ansett quickly became a household name and was most noted for its innovative flight experience coupled with world-leading customer service. But after it folded in 2001, the brand appeared to never fly again. But Frantzekos spied an opportunity in the moldering trademark, which had expired. Rather than siphoning the defunct airline’s DNA, he rebuilt the brand as an ultra-modern travel tech platform that prides itself on deep personalization and machine learning to serve 21st-century travelers’ changing needs.

AI-Driven Personalization for Modern Travelers

Ansett. Travel, Australia’s first travel agency wholly powered by A.I. The platform seeks to provide a more intelligent and personalized experience by mining users’ preferences using algorithms and machine learning. The AI makes personalized travel recommendations for trips, activities and experiences over time — it’s like your own personal travel concierge in the cloud. Users enter information about their travel experience — like the location, dates and interests at play—and an AI powered program conjures up bespoke itineraries, activities and amenities for them.

For instance, a user could plan for having their mate from Melbourne visit them to watch a major sports event such as the Ashes. The AI would then suggest things to do in the area and local accommodations/restaurants that suit their tastes. Private Charter Members also get the benefit of buying these services at very close to wholesale on Ansett VIP.

An Affordable Business Model Focused on Savings

The business model behind Ansett. Travel is based on two pillars, deep personalization and affordability. Users can enroll in a VIP membership for $99 per year, which entails discounts on flights, hotels and cultural experiences. The platform is planned to provide dramatic savings when compared against old fashioned travel agencies that are expensive in terms of overheads and staff. Instead, Ansett leverages technology to automate all of its operations and invests capital into building a platform while keeping a tiny support team.

Ansett is not a traditional travel agency, which can take the bulk of a dollar when it sells and then enjoys large profit margins. The website intentionally makes their pricing more competitive for travelers and leaves the difference in savings right up on company’s frontpage.

Combining AI with Human Support

Frantzekos draws parallels between Ansett. Travel and companies like Uber, which have bet on personalized service without traditional overhead. The service features a Chrome and Firefox extension (with Safari support coming) that lets consumers compare real-time prices on travel products while visiting other sites.

Despite being AI-driven, Ansett. Travel also reminds you how essential human contact is. With AI responsible for the majority of routine personalization duties, customer support agents can be on hand to help users when there are specific problems or they need assistance urgently. It is this melding of AI efficiency and human hospitality that makes for a smoother travel experience.

What Next, The Future of Ansett

While Ansett. Travel isn’t an airline, but Frantzekos says he wouldn’t rule out possibly branching the brand into air travel in some way down the line. For now he wants to give every Australian access to a next-level travel concierge that aspires on the nostalgia of Ansett with modern AI power. Ansett Australia is reborn in the Digital world, not flying but at the forefront of a new era, transforming travel using blockchain technology.



Source link

Continue Reading

AI in Travel

Ex-Concur Founder Eyes “Perfect Trip” With New Startup Spotnana

Published

on


Steve Singh spent two decades building Concur into the dominant travel-and-expense management platform before selling it to SAP for $8.3 billion in 2014. A year ago he became CEO of Spotnana, a startup that aims to solve the industry’s lingering problems.

The travel technology sector has struggled for years with fragmented systems that force companies to cobble together bookings from multiple sources while maintaining adequate customer service.

These back-end issues have delayed the arrival of what Singh called “The Perfect Trip” in an interview with Skift in 2014.

Now Singh argues that today’s cloud-native computing and machine learning can solve problems that proved intractable when he first tackled them at Concur more than 40 years ago.

“I haven’t been this excited about how tech can improve the corporate travel experience since mobile phones became widespread,” Singh said in an interview at Global Business Travel Association conference in Denver last month.

Steve Singh, CEO of Spotnana, seated in white shirt at the company’s recent conference. Singh works with key executives like Sarosh Waghmar at Spotnana, Naveen Singh at Center, Dennis Vilovic at Troop, and Christal Bemont at Direct Travel. Source: Spotnana

Automating Services

Spotnana’s approach centers on automating routine travel services like rebookings and refunds.

For corporate customers buying the travel, Spotnana will offer business intelligence tools and analytical services to let executives more clearly understand what their employees are spending on travel.

“Instead of a 15% cut across the board, which is indiscriminate, what if an AI agent could say, ‘I’ll get you the 15% savings by reducing travel spend by 40% for people that are not revenue producing while not reducing it at all for others, thanks to the intel I know on the clients they’re visiting and the productivity of those employees on the road,’” Singh said.

Singh claimed Spotnana could reduce travel management companies’ operational costs by roughly half. The tech vendor said it doesn’t accept global distribution system incentives and doesn’t hide or bias content to reach supplier volume targets.

Singh said Spotnana expects to deploy its AI agent capabilities within the next two to three years.

He described plans for “an AI agent that was trained on, say, your top 10% of your corporate travel agents” that could provide consistent, scalable service while understanding individual traveler preferences and company policies.

“Imagine an AI agent that not only knows me and my corporate policies and my personal preferences, but then it can also be an expert in every city I want to go for work or for leisure,” Singh said. “That starts to deliver a client experience that is no different than the world’s best executive assistant.”

Singh said that AI may also help with either predicting and responding in the moments when trips are disrupted by cancellations.

Automated reactions are key, he said: “If my flight is delayed, I shouldn’t have to pick up my phone and call somebody to change flights. Why can’t there be a recommendation pushed right into my app, saying here are the three options within your company’s travel policy, here are the three options outside your policy. Which one would you like?”

Frenemies

Spotnana, which has disclosed raising over $100 million in funding, faces established competitors with services that overlap.

While Spotnana is not a travel management company, its technology and full-content approach are similar to travel management companies like Navan (which has raised over $1.2 billion in funding) and TravelPerk (over $700 million).

Yet some industry observers remain skeptical about whether new technology can overcome the travel sector’s entrenched interests and complex commercial relationships. The American Airlines’ ill-fated effort to change how corporations and travel management companies book business travel suggests the challenges facing any attempt to change distribution.

But Singh said cloud computing costs are “one-tenth” of what they were 15 to 20 years ago. Key corporate travel systems are now cloud-native and use modern APIs, or data exchange methods.

More importantly, suppliers, buyers, and travel management companies have greater incentives to change the status quo, he said.

Spotnana offers its tech to Direct Travel, a company Singh also backs, and other travel management companies, such as Solutions Travel. It works with corporate buyers via connections with their preferred travel management companies.

Yet Spotnana is also a tool for the suppliers themselves.

“We think there’s multiple tiers of opportunity with our supplier partners,” Singh said. “One is the content distribution to travel management companies. But the other is that most of our supplier partners also want us to build other services for them.”

Spotnana’s effort to be all things to all people could get dicey if travel management companies come to fear it as potentially siphoning off their business by competing on fees and services to woo buyers.

Singh said he sees Spotnana’s opportunity with suppliers as being in providing services that travel management companies typically don’t, such as by giving suppliers deeper insights into their customers.

A case in point: Spotnana has partnered with Marriott to power the hotel chain’s small business portal, Business Access, handling both content distribution and booking management.

“We’re taking advantage of the biggest transformation I’ve seen in travel since we moved from paper based tickets to digital,” Singh said.



Source link

Continue Reading

Trending

Copyright © 2025 AISTORIZ. For enquiries email at prompt@travelstoriz.com